scanKeys(t, f) applies the function f to each key in the hash table t.
i1 : t = hashTable {{1,8},{2,20},{3,4},{4,20}}
o1 = HashTable{1 => 8 }
2 => 20
3 => 4
4 => 20
o1 : HashTable
|
i2 : scanKeys(t, print) 1 2 3 4 |
i3 : scanKeys(t, k -> if k>2 then print t#k) 4 20 |
This function requires an immutable hash table. To scan the keys in a mutable hash table, use scan(keys t, f).
The object scanKeys is a method function.