select(ZZ,HashTable,Function) -- select a limited number of pairs from a hash table

Synopsis

• Function: select
• Usage:
select(n,v,f)
• Inputs:
• Outputs:
• , whose pairs are those key-value pairs of the hash table v that yield true when the function f is applied to the value, except that at most n pairs will be selected

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(1,x,odd) o2 = HashTable{x => 1} o2 : HashTable