-
Notifications
You must be signed in to change notification settings - Fork 1
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
repeat {} doesn't repeat when it's last item inside a sub called from a loop #5445
Comments
From @zoffixznetThe repeat {} block must execute the block at least once, even if the condition is false. That works fine in a loop: zoffix@VirtualBox:~/CPANPRC$ cat test.p6 And it works fine when in a sub that is called: zoffix@VirtualBox:~/CPANPRC$ cat test.p6 foo; But if we call that sub in a loop, repeat no longer gets called: zoffix@VirtualBox:~/CPANPRC$ cat test.p6 foo for ^2; See also https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127563#ticket-history which may or may not be related -- |
From @zoffixznetzoffix@VirtualBox:~/CPANPRC$ perl6 -v |
From @zoffixznet'been a long day and I forgot one key point. It starts to work fine if we don't make it the last item in the sub: zoffix@VirtualBox:~/CPANPRC$ cat test.p6 foo for ^2; -- |
From @zoffixznetFudged tests added in Raku/roast@9236d81b3e |
From @TimToadyThe repeat and loop constructs were not properly sinking themselves at statementlist level. Fixed in 589061eac14f2847e2c4b401d2ff2eb30c62675e Untodo'd existing test. |
1 similar comment
From @TimToadyThe repeat and loop constructs were not properly sinking themselves at statementlist level. Fixed in 589061eac14f2847e2c4b401d2ff2eb30c62675e Untodo'd existing test. |
@TimToady - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#128596 (status was 'resolved')
Searchable as RT128596$
The text was updated successfully, but these errors were encountered: