3.3.5 Hash Functions within the Interpreter

ns stores a reference to every TclObject in the compiled hierarchy in a hash table; this permits quick access to the objects. The hash table is internal to the interpreter. ns uses the name of the TclObject as the key to enter, lookup, or delete the TclObject in the hash table.

*
[TclObject* $o$]tcl.enter../Tcl/Tcl.ccTcl::enter will insert a pointer to the TclObject $o$ into the hash table.

It is used by []TclClass::create_shadow../Tcl/Tcl.ccTclClass::create_shadow to insert an object into the table, when that object is created.

*
[char* $s$]tcl.lookup../Tcl/Tcl.hTcl::lookup will retrieve the TclObject with the name $s$.

It is used by []TclObject::lookup../Tcl/Tcl.hTclObject::lookup.

*
[TclObject* $o$]tcl.remove../Tcl/Tcl.ccTcl::remove will delete references to the TclObject $o$ from the hash table.

It is used by []TclClass::delete_shadow../Tcl/Tcl.ccTclClass::delete_shadow to remove an existing entry from the hash table, when that object is deleted.

These functions are used internally by the class TclObject and class TclClass.

Tom Henderson 2011-11-05