Jonathan Lang (>>), Daniel (>):
>> So:
>>
>>    1, 3 ... 13 # same as 1,3,5,7,9,11,13
>>    1 ... 10 # same as 1,2,3,4,5,6,7,8,9,10
>>    1, 2, 4 ... 100 # same as 1,2,4,8,16,32,64
>
> That last one doesn't work on Rakudo :-(

And it never will. Note that 100 is not a power of 2, and that the
goal needs to match exactly. This is because smartmatching is used,
not some other comparison. The sequence will continue to generate
numbers until the number 100 is generated, which never happens. Rakudo
loops forever on this one, as per spec.

If you're wondering why things are factored in this way, it's because
previous versions of the spec that tried to special-case 100 to work
in cases like the above, ended up not working out. It turned out that
the unification of infix:<...> and smartmatching was what did work. It
has the slight drawback that we have to educate users to write * >=
100 instead of 100 in the case of not-exactly-matching goal states.
But it's still a net win, because this unified semantics works better
than anything we had before.

// Carl

Reply via email to