Wouldn't "1,3,5,7" be a more reasonable result? The next value, "9" is
greater than the end term, so it should stop?

On 10/16/14, Carl Mäsak via RT <perl6-bugs-follo...@perl.org> wrote:
> bartolin (>):
>> Actually I don't think S03 says that '1,3,5 ... 8' should act as
>> '1,3,5 ... *'
>>
>> As I understand it '1,3,5 ... 8' gives an infinite list with all even
>> numbers. '1,3,5 ... *' also gives an infinite list with all even
>> numbers -- but this one is lazy.
>>
>> So there is a difference in behaviour: When assigning to an array with
>> 'my @odd = 1,3,5 ... 8;' all elements of the sequence have to be
>> computed and smart matched agains '8'. This match never results in
>> True and therefore we get a timeout, finally. In the other case ('my
>> @odd = 1,3,5 ... *') "the sequence has no limit" (quote from S03) and
>> the assignment can be lazy e.g. the values don't have to be computed
>> and smart matched against something.
>
> I think this reasoning is sound, and whereas it would be awesome if we could
> always read the mind of the user and not get stuck in infinite loops trying
> to compute infinite sequences -- the place we are is kind of a local minimum
> and has an internal consistency.
>
> That is, we could perhaps do better in the future, and not hang on this one.
> But it's not clear to me how to do that without making the current model
> more complex for relatively little gain.
>
> Rejecting ticket.
>

Reply via email to