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

applyValues -- apply a function to each value in a hash table

Synopsis

Description

i1 : H = new HashTable from {1 => 10, 2 => 15, 3 => 20}

o1 = HashTable{1 => 10}
               2 => 15
               3 => 20

o1 : HashTable
i2 : applyValues(H, v -> v + 100)

o2 = HashTable{1 => 110}
               2 => 115
               3 => 120

o2 : HashTable
i3 : applyValues(H, v -> 1)

o3 = HashTable{1 => 1}
               2 => 1
               3 => 1

o3 : HashTable

See also

Ways to use applyValues :

For the programmer

The object applyValues is a compiled function.