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
For (1..10000000000) bug #923
Comments
From @teodozjan$ cat normal.pl; ./perl6 normal.pl $ cat destroyer.p6; ./perl6 destroyer.p6 for (1..10000000000){ $ ./perl6 --version Copyright 2006-2008, The Perl Foundation. updated a while ago -- |
From @teodozjanI've tried on another machine: Copyright 2006-2008, The Perl Foundation. It eats whole cpu and starts eating memory. -- |
From @masakOn Tue Apr 21 13:07:28 2009, teodozjan@gmail.com wrote:
Rakudo does somethings eagerly that will eventually be done lazily in |
The RT System itself - Status changed from 'new' to 'open' |
From @bbkrlists are now lazy and the given example works. $ perl6 -e 'say "start"; my $flag=0; for (1..10000000000) { say "never |
From @bbkrand timings, proving that the list is lazy real 0m1.499s |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S04-statements/for.t commit 651ee826e32816a994dd7c7ba3ff8da1f712ed36 [t/spec] tests for RT #64886 For (1..10000000000) bug Inline Patchdiff --git a/t/spec/S04-statements/for.t b/t/spec/S04-statements/for.t
index ea1acf0..d9858f4 100644
--- a/t/spec/S04-statements/for.t
+++ b/t/spec/S04-statements/for.t
@@ -478,6 +478,16 @@ eval 'for (my $x; $x <=3; $x++) { $i; }'; diag($!);
ok $! ~~ / 'C-style' /, 'Sensible error message';
}
+# RT #64886
+{
+ my $a = 0;
+ for (1..10000000000) {
+ $a++;
+ last;
+ }
+ is $a, 1, 'for on Range with huge max value is lazy and enters block';
+}
+
done_testing;
# vim: ft=perl6 |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S04-statements/for.t commit 51b09b45c0597613232fd53586817afd83626cfc [t/spec] tests for RT #64886 For (1..10000000000) bug Inline Patchdiff --git a/t/spec/S04-statements/for.t b/t/spec/S04-statements/for.t
index d9858f4..55d6c6e 100644
--- a/t/spec/S04-statements/for.t
+++ b/t/spec/S04-statements/for.t
@@ -242,7 +242,6 @@ my @elems = <a b c d e>;
# .key //= ++$i for @array1;
class TestClass{ has $.key is rw };
-#?rakudo skip '[+] NYI'
{
my @array1 = (TestClass.new(:key<1>),TestClass.new());
|
From @bbkrrechecked on * release, also works |
@bbkr - Status changed from 'open' to 'resolved' |
From @bbkrignore 31872 commit |
Migrated from rt.perl.org#64886 (status was 'resolved')
Searchable as RT64886$
The text was updated successfully, but these errors were encountered: