Skip to content

ForRange

Name - Description Default Type
<input> The input value is not used and will pass through. Any
<output> The output of this shard will be its input. Any
From The initial iteration value (inclusive). 0 Int&Int
To The final iteration value (inclusive). 1 Int&Int
Action The action to perform at each iteration. The current iteration value will be passed as input. None Shard[ Shard ]

Executes a shard while an iteration value is within a range.

Examples

1
2
3
4
5
6
7
8
;; Sum all positive integers below 1000
0 >= .sum

(ForRange
 1 999
 (-> (Math.Add .sum) > .sum))

.sum (Assert.Is 499500 true)