Tinderbox v9 Icon

List/Set.collect(label,expression)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 List   [operators of similar scope]

 Dictionary, Set & List operations   [other Dictionary, Set & List operations operators]

 9.0.0

 


List/Set.collect(label, expression)

Each item in the list is bound in turn to label (an attribute name, and then the expression is evaluated). The operator returns a list of all the results. This can also be understood as if collect_if(list, expression, list item).

$MyListA = $MyList.collect(x,x+1) returns 2;3;4;5;6

$MyListA = $MyList.collect(x,x*x) returns ;4;9;16;25



A Tinderbox Reference File : Actions & Rules : Operators : Full Operator List : List/Set.collect(label,expression)