Select items from collection.

select condition collection

Returns new collection of items selected from the input collection for which condition expression returns true. Condition expression can use :value of tested item and its :index within the input collection.

Example:

"a := (random 0 10 10)
print :a
print select :value % 2 = 0 :a ;even values
print select :index % 2 = 0 :a ;even indices

Output:

{3 0 8 5 4 5 0 1 5 3}
{0 8 4 0}
{0 5 5 1 3}

See also:

Operations on data sets
Mathematical operations

Table of Content