Collection select by st expression

Aus ExpeccoWiki

Wechseln zu: Navigation, Suche

Collection [ Select/Reject by ST Expression ]

Collection select by st expression.png

Passes incoming elements for which a given expression returns true to the output.

The filterblock is specified as an arbitrary Smalltalk 1-arg block, such as:

   [:datum | datum asCollectionOfWords second asInteger > 100 ]

to filter all input-values where the second column contains a numeric value > 100.

Use this if incoming data is to be processed in a stream like fashion.

Collection [ Collect by ST Expression ]

Collection collect by st expression.png

Generate a new collection containing the results from applying the given expression block to each element.

The block is specified as an arbitrary Smalltalk 1-arg block, such as:

   [:datum | datum * 2 ]

to generate a collection containing doubled elements.

Revisions

These blocks have been in the Standard Library since 1.7.2.



Back to Standard Library.
Previous: Collection [ Select Columns ]
Next: Collection [ Sort ]


Meine Werkzeuge