next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: applyKeys(HashTable,Function)

applyKeys(HashTable,Function) -- apply a function to each key in a hash table

Synopsis

Description

i1 : H = new HashTable from {1 => a, 2 => b, 3 => c}

o1 = HashTable{1 => a}
               2 => b
               3 => c

o1 : HashTable
i2 : applyKeys(H, k -> k + 100)

o2 = HashTable{101 => a}
               102 => b
               103 => c

o2 : HashTable

Caveat

It is an error for the function f to return two pairs with the same key. If such a case may occur, use applyKeys(HashTable,Function,Function) instead.

See also