Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #393 from usev6/nom
Don't return previous value when generator function of sequence calls 'last'
  • Loading branch information
FROGGS committed Mar 23, 2015
2 parents af6bd02 + bc08619 commit 9b5d4e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/operators.pm
Expand Up @@ -187,6 +187,7 @@ sub SEQUENCE($left, Mu $right, :$exclude_end) {
my $count = $code.count;
while 1 {
$tail.munch($tail.elems - $count);
$value := Nil; ## don't return previous value when 'last' is called from $code
$value := $code(|$tail);
if $end_code_arity != 0 {
$end_tail.push($value);
Expand Down

0 comments on commit 9b5d4e2

Please sign in to comment.