Hybrid Sorted Tables Reference

Version 4.11   (c) Jiri Babor   September 2002

Note: Types of variables are indicated by bold prefixes.


bsearch_length
comment:integer : minimum table length for binary search, adjustable by user

dups
syntax:s = dups(table)
comment:returns sequence of all duplicate entries in table

ET
comment:constant, empty table, ET = {{}}
example:
sequence mytable

mytable = ET

fetch
syntax:ovalue = fetch(table, okey)
comment:return value of table element with specified key

index
syntax:i = index(table, okey)
comment:return key index, or zero if key is not found
frequently used to verify existence of an entry

insert
syntax:tmodified = insert(table, okey, ovalue)
comment:insert new entry, return modified table
see also:set

merge
syntax:table = merge(table1, table2)
comment:combine table1 with table2
return sorted combined table

remove
syntax:tmodified = remove(table, okey)
comment:remove entry with the specified key, return modified table

set
syntax:tmodifiedtable = set(table, okey, onewvalue)
comment:replace specified table item with a new value
return modified table
see also:insert

tsort
syntax:tmodifiedtable = tsort(table)
comment:shell sort table by keys in ascending order