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
After giving Seq it's own join method, redo behaves strange in grep #5992
Comments
From @usev6With rakudo commit 3c52aa096c Seq got it's own join method. For some reason < bartolin> m: my $attempts = 0; say (1..5).grep({if $_ == 3 {$attempts++; redo unless $attempts == 10}; $_}).join("|"); say "looked $attempts times for element 3" Further discussion here: https://irclog.perlgeek.de/perl6-dev/2017-01-08#i_13878701 |
From @usev6On Sun, 08 Jan 2017 05:11:03 -0800, bartolin@gmx.de wrote:
Also, next/redo in grep die on rakudo-j when using the new join method: $ ./perl6-j -e 'say (1..4).grep({next if $_ == 3; $_}).join("|")' $ $ ./perl6-j -e 'my $retries = 0; say (1..5).grep({if $_ == 3 {$retries++; redo unless $retries == 10}; $_}).join("|"); say "looked $retries times for element 3"' Please note, that the evaluations work as expected when using perl instead of join: $ ./perl6-j -e 'say (1..4).grep({next if $_ == 3; $_}).perl' $ ./perl6-j -e 'my $retries = 0; say (1..5).grep({if $_ == 3 {$retries++; redo unless $retries == 10}; $_}).perl; say "looked $retries times for element 3"' |
1 similar comment
From @usev6On Sun, 08 Jan 2017 05:11:03 -0800, bartolin@gmx.de wrote:
Also, next/redo in grep die on rakudo-j when using the new join method: $ ./perl6-j -e 'say (1..4).grep({next if $_ == 3; $_}).join("|")' $ $ ./perl6-j -e 'my $retries = 0; say (1..5).grep({if $_ == 3 {$retries++; redo unless $retries == 10}; $_}).join("|"); say "looked $retries times for element 3"' Please note, that the evaluations work as expected when using perl instead of join: $ ./perl6-j -e 'say (1..4).grep({next if $_ == 3; $_}).perl' $ ./perl6-j -e 'my $retries = 0; say (1..5).grep({if $_ == 3 {$retries++; redo unless $retries == 10}; $_}).perl; say "looked $retries times for element 3"' |
From @lizmatFixed with 362f674 , tests needed.
|
The RT System itself - Status changed from 'new' to 'open' |
From @usev6A test was added with Raku/roast@90c58ff0eb |
1 similar comment
From @usev6A test was added with Raku/roast@90c58ff0eb |
@usev6 - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#130529 (status was 'resolved')
Searchable as RT130529$
The text was updated successfully, but these errors were encountered: