Skip to content
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

take on an array flattens the array into the gather list in Rakudo #2584

Closed
p6rt opened this issue Dec 25, 2011 · 4 comments
Closed

take on an array flattens the array into the gather list in Rakudo #2584

p6rt opened this issue Dec 25, 2011 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 25, 2011

Migrated from rt.perl.org#106986 (status was 'resolved')

Searchable as RT106986$

@p6rt
Copy link
Author

p6rt commented Dec 25, 2011

From @masak

< simon__> hello. I'm trying to make a list of lists with gather for
but it keeps flattening the result. can someone tell me what i'm doing
wrong?
<masak> simon__​: maybe make a list of arrays instead?
<masak> lists of lists often flatten, because Perl works that way.
<masak> nom​: say (gather { take [1..$_] for 4..6 }).perl
<p6eval> nom eb6c4b​: OUTPUT«(1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6).list␤»
<masak> huh.
<simon__> that's what i've been doing
<masak> nom​: say (gather { take [[1..$_]] for 4..6 }).perl
<p6eval> nom eb6c4b​: OUTPUT«([1, 2, 3, 4], [1, 2, 3, 4, 5], [1, 2, 3,
4, 5, 6]).list␤»
<masak> using double layers seems to work.
<sorear> eheheheh... I don't think it should work that way
<masak> but no, it seems wrong that it works so from the start in nom.
<masak> probably a bug.
<sorear> b​: say (gather { take [1..$_] for 4..6 }).perl
<p6eval> b 1b7dd1​: OUTPUT«([1, 2, 3, 4], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5, 6])␤»
<sorear> niecza​: say (gather { take [1..$_] for 4..6 }).perl
<p6eval> niecza v12-177-g9a8aaf4​: OUTPUT«([1, 2, 3, 4], [1, 2, 3, 4,
5], [1, 2, 3, 4, 5, 6]).list␤»
<sorear> pugs​: say (gather { take [1..$_] for 4..6 }).perl
<p6eval> pugs b927740​: OUTPUT«([1, 2, 3, 4], [1, 2, 3, 4, 5], [1, 2,
3, 4, 5, 6])␤»
<sorear> nomgression
* masak submits rakudobug
<sorear> hey, the masakbot is back
<masak> simon__++ # for discovering

@p6rt
Copy link
Author

p6rt commented Jan 6, 2012

From @jnthn

Was fixed recently, and has tests; resolving.

@p6rt
Copy link
Author

p6rt commented Jan 6, 2012

@jnthn - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Jan 6, 2012
@p6rt
Copy link
Author

p6rt commented Jan 6, 2012

From @moritz

This has been fixed recently, and is tested for example in
S04-statements/gather.t.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant