New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
foreach ("", "a".."zzzzzz") confuses range optimizer #7352
Comments
From @schwernCreated by @schwernA co-worker exhausted his machine's memory trying to compile this: for ( '', 'a'..'zzzzzzz' ) {} B::Deparse (using 'zzz') reveals that Perl is trying to build that Our work around is: for ( $i = ""; $i ne "aaa"; ($i = $i ? ++$i : "a") ) { print $i } Bug/optimizer-miss appears in 5.6.1, 5.8.1 and 5.8.3. Perl Info
|
From @iabynOn Tue, Jun 08, 2004 at 08:38:52PM -0000, Michael G Schwern wrote:
I'm not sure how this can be construed as a bug. In the general Dave. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @davidnicolJust curious -- does the range optimization in C<for> apply to slices? foreach(@Array[$left .. $right]){ -- |
From @ysthOn Fri, Sep 10, 2004 at 03:34:00AM -0500, David Nicol wrote:
No. |
From @schwernOn Thu, 9 Sep 2004 22:47:35 +0100, Dave Mitchell <davem@iabyn.com> wrote:
I have high expectations. Call it a feature request if it makes you feel better. I reported it |
From @jkeenanOn Fri Oct 15 09:32:02 2004, schwern wrote:
Schwern, Is this still on your wishlist? Thank you very much. |
From @cpansproutOn Sat Sep 29 19:08:16 2012, jkeenan wrote:
It’s on *mine*. -- Father Chrysostomos |
From @wolfsageOn Sun, Sep 30, 2012 at 1:27 AM, Father Chrysostomos via RT <
Is there anything blocking this from happening, or just the usual (time, Is there any other case besides for/foreach that 'a..z' should iterate on -- Matthew Horsfall (alh) |
From @cpansproutOn Sat Nov 24 07:03:37 2012, alh wrote:
The usual, plus lack of inspiration.
I hadn’t thought of that, but if it could iterate on the fly in more -- Father Chrysostomos |
From @LeontOn Sat, Nov 24, 2012 at 4:34 PM, Father Chrysostomos via RT
It would be awesome if we had real lazy lists, but that would require Leon |
From @wolfsageOn Sat, Nov 24, 2012 at 10:34 AM, Father Chrysostomos via RT <
I see these as being sensible uses of iteration: for ('a'..'z', qw(cat dog mouse), 1..10) { print $_ } my @found = grep { $_ =~ /./ } 1..10; my %hash = map { $_ => 1 } 1..10*;* But should this iterate at runtime or be pregenerated as it is now? my @arr = (1..10); If it's in a sub that's never hit, there's a memory saving there if it -- Matthew Horsfall (alh) |
From @wolfsage---------- Forwarded message ---------- On Sat, Nov 24, 2012 at 11:09 AM, Leon Timmermans <fawaka@gmail.com> wrote:
Yeah, that's what I was thinking it'd be nice to have. The logic is sort of -- Matthew Horsfall (alh) |
From @cpansproutOn Sat Nov 24 08:16:13 2012, alh wrote:
That’s a hard question. :-)
-- Father Chrysostomos |
From @wolfsageOn Sat, Nov 24, 2012 at 3:57 PM, Father Chrysostomos via RT <
I suppose we could slap together a C version of less.pm and then let users -- Matthew Horsfall (alh) |
From @druud62On 2012-11-25 14:13, Matthew Horsfall (alh) wrote:
Or add support for modifiers, like "a".."zzzzzzzzzzz":i -- |
Migrated from rt.perl.org#30123 (status was 'open')
Searchable as RT30123$
The text was updated successfully, but these errors were encountered: