Macaulay2 » Documentation
Packages » Macaulay2Doc > The Macaulay2 language > hash tables > hashTable
next | previous | forward | backward | up | index | toc

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 :

For the programmer

The object hashTable is a compiled function.