It was revision 28928 that introduced this difference between the for
statement and statement-modifying for. I'm not sure exactly what issue
it intended to fix, but if I undo that revision everything works
according to my (not necessarily correct) expectations.

$ svn log -r28928
------------------------------------------------------------------------
r28928 | pmichaud | 2008-07-02 03:37:22 +0200 (Wed, 02 Jul 2008) | 4 lines

[rakudo]:
Make sure the expression in a for statement is interpreted in
list context.  cjfields++ for finding and reporting this.

------------------------------------------------------------------------

$ svn di -r28927:28928
Index: languages/perl6/src/parser/actions.pm
===================================================================
--- languages/perl6/src/parser/actions.pm       (revision 28927)
+++ languages/perl6/src/parser/actions.pm       (revision 28928)
@@ -307,7 +307,7 @@
     my $block := $( $<pblock> );
     $block.blocktype('declaration');
     my $past := PAST::Op.new(
-        $( $<EXPR> ),
+        PAST::Op.new(:name('list'), $($<EXPR>)),
         $block,
         :pasttype($<sym>),
         :node( $/ )

Reply via email to