Go to the first, previous, next, last section, table of contents.


Class Hash

Like Index objects, Hash objects serve to map arbitrary keys to values:

root:
makeHash --> _h
root:
12 --> _h["12"]
root:
_h["12"]
root: 12

Values are stored in four hashed b-trees (one each for hidden, public, system and admins properties) stored on the hash object.

As a result, hash objects need three slots per key-val pair (key, hashed-key, val) rather than just two as in Index objects.

In compensation, lookup may be significant faster in hash objects if key comparisons are expensive -- for example, if the keys are long strings which differ only in the last few characters.

Note that values will be read out of a Hash in an arbitrary appearing order (that dictated by the hash function): If sorted readout order is a requirement, you should use an Index instead.

See section Class Index. See section Class Set.


Go to the first, previous, next, last section, table of contents.