# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #106986]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=106986 >


< 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

Reply via email to