select(HashTable,Function) -- select part of a hash table

Synopsis

• Function: select
• Usage:
select(v,f)
• Inputs:
• Outputs:
• , whose pairs are those key-value pairs (k,w) of the hash table v that yield true when the function f is applied to the value w.

Description

The hash table v should be immutable: to scan the values in a mutable hash table, use scan(values x, f).
 i1 : x = new HashTable from { x => 1, y => 2, z => 3 } o1 = HashTable{x => 1} y => 2 z => 3 o1 : HashTable i2 : select(x,odd) o2 = HashTable{x => 1} z => 3 o2 : HashTable

See also

• partition -- partition a set or list by values of a function