+static slotinfo_t* find_class(const char*name);
+
+const char* lookup_namespace(const char*name)
+{
+ state_t*s = state;
+ while(s) {
+ const char*url = dict_lookup(s->namespaces, name);
+ if(url)
+ return url;
+ s = s->old;
+ }
+ varinfo_t*a;
+ registry_find(state->package, name);
+ if(( a = (varinfo_t*)find_class(name) )) {
+ if(a->kind == INFOTYPE_VAR) {
+ if(!a->value || !NS_TYPE(a->value->type))
+ syntaxerror("%s.%s is not a namespace", a->package, a->name);
+ return a->value->ns->name;
+ }
+ }
+ return 0;
+}
+