Permalink
Browse files

Quick fix to do something more useful with sequence closures that ret…

…urn multiple values (fixes #109)
  • Loading branch information...
1 parent a5f35dc commit 03088712fbb7b13a0dbc216c620579283397242a @sorear committed May 21, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/CORE.setting
View
@@ -3125,11 +3125,11 @@ our sub Niecza::generate-series(@lhs, $rhs, :$exclude-limit) {
my @args=@lhs[$i-($arity ~~ Inf ?? $i !! $arity) .. $i-1]; #We make sure there are $arity elems in args
loop { #Then we extrapolate using $next and the $args
- my $current = $next.(|@args) // last;
- take $current ;
+ my \current = $next.(|@args) // last;
+ take current ;
if $arity {
- @args.push($current) ;
- @args.shift if @args.elems > $arity
+ @args.push(current) ;
+ @args.shift while @args.elems > $arity
}
}
}

0 comments on commit 0308871

Please sign in to comment.