+// ----------------------- memberinfo methods ------------------------------
+
+/* hacky code to wrap a variable or function into a "type"
+ object, but keep a pointer to the "value" */
+static dict_t* functionobjects = 0;
+classinfo_t* slotinfo_asclass(slotinfo_t*f) {
+ if(!functionobjects) {
+ functionobjects = dict_new2(&ptr_type);
+ } else {
+ classinfo_t*c = dict_lookup(functionobjects, f);
+ if(c)
+ return c;
+ }
+
+ classinfo_t*c = rfx_calloc(sizeof(classinfo_t)+sizeof(classinfo_t*));
+ c->access = ACCESS_PUBLIC;
+ c->package = "";
+ if(f->kind == INFOTYPE_METHOD)
+ c->name = "Function";
+ else if(f->kind == INFOTYPE_CLASS)
+ c->name = "Class";
+ else if(f->kind == INFOTYPE_SLOT)
+ c->name = "Object";
+ else {
+ c->name = "undefined";
+ }
+
+ dict_init(&c->members,1);
+ c->data = f;
+ dict_put(functionobjects, f, c);
+ return c;
+}
+
+classinfo_t* slotinfo_gettype(slotinfo_t*f)
+{
+ if(f) {
+ if(f->kind == INFOTYPE_METHOD) {
+ return slotinfo_asclass(f);
+ } else if(f->kind == INFOTYPE_SLOT) {
+ varinfo_t*v = (varinfo_t*)f;
+ return v->type;
+ } else
+ return 0;
+ } else {
+ return registry_getanytype();
+ }
+}