-
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
Using take on a listy expression doesn't take each element of that list #4320
Comments
From @hoelzroSee the attached test file; for example: my @result = gather { take 'foo=bar'.split('=') }; results in an empty array, when it should result in an array with 'foo' and 'bar' as its contents. |
From @usev6This now fails with X::Seq::Consumed: $ perl6-m -e 'my @result = gather { take "foo=bar".split("=") }; say @result' Adding a 'flat' gives the expected result, though: $ perl6-m -e 'my @result = flat gather { take "foo=bar".split("=") }; say @result.perl' $ perl6-m -e 'my @result = gather { take "foo=bar".split("=") }.flat; say @result.perl' Since this behaviour looks good to me, I added a test to S04-statements/gather.t with commit Raku/roast@de87d7958b. Also, I'm closing this ticket as 'resolved'. |
1 similar comment
From @usev6This now fails with X::Seq::Consumed: $ perl6-m -e 'my @result = gather { take "foo=bar".split("=") }; say @result' Adding a 'flat' gives the expected result, though: $ perl6-m -e 'my @result = flat gather { take "foo=bar".split("=") }; say @result.perl' $ perl6-m -e 'my @result = gather { take "foo=bar".split("=") }.flat; say @result.perl' Since this behaviour looks good to me, I added a test to S04-statements/gather.t with commit Raku/roast@de87d7958b. Also, I'm closing this ticket as 'resolved'. |
@usev6 - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#125401 (status was 'resolved')
Searchable as RT125401$
The text was updated successfully, but these errors were encountered: