http://qs321.pair.com?node_id=11133566


in reply to Re^4: [Raku] Ranges in array slices
in thread [Raku] Ranges in array slices

To make sure, we're on the same page, the sequence of even numbers can end:
> say 0, * + 2 ... $_ for 2, 10 (0 2) (0 2 4 6 8 10)
And if this was obvious, then - yes, that's the point. Sequences allow this kind of dissonances. No error is reported by the language. There's space for absurd. Or what should this be better called?

Replies are listed 'Best First'.
Re^6: [Raku] Ranges in array slices
by holli (Abbot) on Jun 05, 2021 at 21:08 UTC
    I see no dissonance or absurdity here. The code creates two Sequences in a loop and they end because the end conditions (2 and 10) (the thing to the right of ....) get reached.
    If you create a sequence like 0, * + 2 ... 1 where the values go up and the end value is smaller than even the first calculated value, then that Seq. will can never end.


    holli

    You can lead your users to water, but alas, you cannot drown them.
Re^6: [Raku] Ranges in array slices
by LanX (Saint) on Jun 05, 2021 at 21:00 UTC