static void addBindings(MultinameHashtable* bindings, TraitsBindingsp tb, uint32_t flags) { if (!tb) return; if ((flags & TypeDescriber::HIDE_OBJECT) && !tb->base) return; addBindings(bindings, tb->base, flags); for (int32_t index = 0; (index = tb->next(index)) != 0; ) { bindings->add(tb->keyAt(index), tb->nsAt(index), tb->valueAt(index)); } }
ArrayObject *DomainObject::getVariables (Atom a) { ArrayObject *result = toplevel()->arrayClass->newArray(0); TraitsBindingsp traits = getTraits(a)->getTraitsBindings(); int i = 0; while ((i = traits->next(i)) != 0) { Namespace *ns = traits->nsAt(i); Stringp name = traits->keyAt(i); Binding b = traits->valueAt(i); if (core()->isVarBinding(b) && ns->getType() == Namespace::NS_Public) { Atom nameAtom = core()->internString(name)->atom(); result->push(&nameAtom, 1); } } return result; }