Skip to content

Commit

Permalink
make for-loops eager again
Browse files Browse the repository at this point in the history
lazy for-loops violated too many expectations, and I do not see the point
in having it lazy, and then jumping through many hoops just to make it
eager again in 98% of all cases.
If you want a lazy loop, please use map.
  • Loading branch information
moritz committed Apr 1, 2013
1 parent 2441b01 commit 983efea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Perl6/Actions.pm
Expand Up @@ -646,6 +646,9 @@ class Perl6::Actions is HLL::Actions does STDActions {
QAST::Op.new(:op('call'), :name('&infix:<,>'), $cond),
block_closure($past)
);
$past := QAST::Op.new(
:op<callmethod>, :name<eager>, $past
);
}
else {
$past := QAST::Op.new($cond, $past, :op(~$ml<sym>), :node($/) );
Expand Down Expand Up @@ -860,6 +863,9 @@ class Perl6::Actions is HLL::Actions does STDActions {
QAST::Op.new(:name('&infix:<,>'), :op('call'), $xblock[0]),
block_closure($xblock[1])
);
$past := QAST::Op.new(
:op<callmethod>, :name<eager>, $past
);
make $past;
}

Expand Down

0 comments on commit 983efea

Please sign in to comment.