develooper Front page | perl.perl5.porters | Postings from November 2012

Re: [perl #30123] foreach ("", "a".."zzzzzz") confuses range optimizer

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
November 24, 2012 08:09
Subject:
Re: [perl #30123] foreach ("", "a".."zzzzzz") confuses range optimizer
Message ID:
CAHhgV8jY4TyWKi4=5wNA8Bw_EHzsZMhnArBRs0LaKuVjUysBmg@mail.gmail.com
On Sat, Nov 24, 2012 at 4:34 PM, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
>> Is there anything blocking this from happening, or just the usual (time,
>> effort, tuits)?
>
> The usual, plus lack of inspiration.
>
>>
>> Is there any other case besides for/foreach that 'a..z' should iterate on
>> the fly rather than immediately generate a list in memory?
>
> I hadn’t thought of that, but if it could iterate on the fly in more
> places it would allow for more idiomatic code.

It would be awesome if we had real lazy lists, but that would require
coroutines first (which is known to be doable, but has many
edge-cases, in particular dynamic scoping ones). Some kind of internal
generator would be a good start though, but would still be
non-trivial.

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About