OCLOperators Set
No edit summary
No edit summary
Line 1: Line 1:
You can use Set with { } to create a set that you may use to loop over, like this:  
You can use Set with { } to create a set that you may use to loop over, like this:  
  Set{1,2,3,4,5,6,7,8,9,10,11,12}->collect(i| DoSomthingWithAnInt(i))
  Set{14,22,12,53,2,11,66}->collect(i| DoSomthingWithAnInt(i))
 
If you want to create a sequence of numbers (in order) you can use the [[Sequence operator]].


Other names for set: array of numbers, static array, initialize array, list of numbers
Other names for set: array of numbers, static array, initialize array, list of numbers
[[Category:OCLOperators]]
[[Category:OCLOperators]]

Revision as of 14:25, 20 October 2020

You can use Set with { } to create a set that you may use to loop over, like this:

Set{14,22,12,53,2,11,66}->collect(i| DoSomthingWithAnInt(i))

If you want to create a sequence of numbers (in order) you can use the Sequence operator.

Other names for set: array of numbers, static array, initialize array, list of numbers

This page was edited 90 days ago on 02/10/2024. What links here