40. Hash Tables
A hash table is a collection of entries, where each entry consists of a key and a value. No two entries may have the same key. Given a key, a hash table can locate its entry very quickly and hence the associated value. Tcl contains a general-purpose hash table package that it uses in several places internally. For example, all of the commands in an interpreter are stored in a hash table where the key for each entry is a command name and the value is a pointer to information about the command. All of the variables in a namespace are stored in another hash table where the key for each entry is the name of a variable and the value is a pointer to information about the variable.
Tcl exports its hash table facilities through a set ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access