# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #77340]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=77340 >
<masak> rakudo: for [] -> $a { say $a.perl }
<p6eval> rakudo 7b0031: OUTPUT«[]»
<masak> is this correct?
<masak> put differently, do things flatten in the <EXPR> position in
the for statement?
<TimToady> [] never flattens in a list
<TimToady> so it's correct
<masak> what about this one?
<masak> rakudo: my %h = foo => []; for %h<foo> -> $a { say $a.perl }
<p6eval> rakudo 7b0031: OUTPUT«[]»
<masak> I find I do such hash accesses when iterating on quantified
Match objects. I'd like to know if I should write %h<foo> or
%h<foo>.list in the for statement.
<masak> not least because bitrot in my code seems to indicate that the
behaviour changed in Rakudo recently :)
<TimToady> I think that one should flatten
<masak> what's the easy rule that distinguishes them?
<TimToady> there's no [] or $ to prevent it in the return from .<>
<masak> so... where there's no explicit "don't flatten" clue, the
thing flattens?
<TimToady> nod
* masak submits rakudobug