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

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

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:

  • applyValues(HashTable,Function)

For the programmer

The object applyValues is a compiled function.


The source of this document is in Macaulay2Doc/functions/applyValues-doc.m2:32:0.