next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc > The Macaulay2 language > hash tables > hashTable

hashTable -- make a hash table

Description

hashTable(h,v) -- produce a hash table from a list v of key-value pairs, with an optional collision handler function h.

The pairs may be of the form a=>b, {a,b}, or (a,b).

Missing entries in the list, represented by null, will be silently ignored.

i1 : x = hashTable {a=>b, c=>d, }

o1 = HashTable{a => b}
               c => d

o1 : HashTable
i2 : x#a

o2 = b

o2 : Symbol
i3 : hashTable(plus, {(a,3),(b,4),(a,10)})

o3 = HashTable{a => 13}
               b => 4

o3 : HashTable

Ways to use hashTable :