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

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

From:
wolfsage
Date:
November 24, 2012 08:17
Subject:
Fwd: [perl #30123] foreach ("", "a".."zzzzzz") confuses range optimizer
Message ID:
CAJ0K8bh3PtVtpCMgdKyPeDnszcp7ahv_qfutSDOuSvp3yKp8xg@mail.gmail.com
---------- Forwarded message ----------
From: Matthew Horsfall (alh) <wolfsage@gmail.com>
Date: Sat, Nov 24, 2012 at 11:16 AM
Subject: Re: [perl #30123] foreach ("", "a".."zzzzzz") confuses range
optimizer
To: Leon Timmermans <fawaka@gmail.com>


On Sat, Nov 24, 2012 at 11:09 AM, Leon Timmermans <fawaka@gmail.com> wrote:

> 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
>

Yeah, that's what I was thinking it'd be nice to have. The logic is sort of
there right now, but it's tied very closely to loops right now and ripping
that out could be painful.

-- Matthew Horsfall (alh)



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