hct - Hash Cell Table
Module Description
The hct module implements a hash table that can store cell wide data.
Module Words
Hash table structure
hct%
( - n )
Get the required space for the hct data structure
Hash table creation, initialisation and destruction
hct-init
( u w:hct - )
Initialise the hash table with an initial size
hct-create
( C: "name" u - R: - w:hct )
Create a named hash table with an initial size in the dictionary
hct-new
( u - w:hct )
Create a new hash table with an initial size on the heap
hct-free
( w:hct - )
Free the table from the heap
Module words
hct+hash
( c-addr u - u )
Calculate the hash value of a key
Member words
hct-empty?
( w:hct - f )
Check for empty table
hct-length@
( w:hct - u )
Get the number of nodes in the list
hct-load@
( w:hct - u )
Get the load factor [*100%]
hct-load!
( u w:hct - )
Set the load factor [*100%]
hct-size!
( u w:hct - )
Resize the hash table
Hash table words
hct-insert
( w c-addr u w:hct - )
Insert a cell with a key in the table
hct-delete
( c-addr u w:hct - false | w true )
Delete key from the table
hct-get
( c-addr u w:hct - false | w true )
Get the cell from the table
hct-has?
( c-addr u w:hct - f )
Check if key is present in the table
Special words
hct-count
( w w:hct - u )
Count the occurences of cell data in the table
hct-execute
( ... xt w:hct - ... )
Execute xt for every key and cell data in table
Inspection
hct-dump
( w:hct - )
Dump the table
generated 09-Jan-2007 by
ofcfrth-0.2.0