NumberRangesealedA numeric interval from start toward end - end-EXCLUSIVE - iterating in steps of 1 (counting down when start > end).
Created with the .. operator on Integer or Double. Mixes in Iterate, so every collection combinator works on it; the match operator ~ (as used by Case when:do: arms) tests containment in the same end-exclusive interval.
(1..5).list "* -> #(1 2 3 4) (3..0).list "* -> #(3 2 1)
Call the block with each number from start toward end (end excluded), stepping by 1 in the range's direction.
var t = 0; (1..5).each:{ |i| t = t + i }; t "* -> 10
Bind the bounds and choose the step: +1 upward, -1 when start > end. Ranges are normally created with start..end rather than new:.
The readable form of the range.
(1..5).s "* -> NumberRange(1..5)
Containment test for the match operator: true when n lies inside the end-exclusive interval (this is what a range condition in a Case when:do: arm checks).
(1..5) ~ 3 "* -> true (1..5) ~ 5 "* -> false