Damian (>>), Daniel (>):
>> Perl 6 already has:  0,$c...*
>>
>> e.g. 0,3...* ----> 0, 3, 6, 9, 12....
>
> Interesting... but it doesn't seem to work in Rakudo Star (2012.02):
>
>> @(2,5..10)
> 2 5 6 7 8 9 10
>
> :-(

Keep in mind that infix:<..> will listify to the kind of
one-step-at-a-time range that was produced above, whereas infix:<...>
is its more DWIMmy cousin and would take the above as counting three
steps at a time.

It would also produce an infinite list, because by the rules you need
the RHS of infix:<...> to match exactly, and 10 is not in the infinite
list 2, 5, 8, 11, 14... Which is why you'd need to write something
like * >= 10.

// Carl

Reply via email to