"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core.c/Supply-coercers.pm6" between
rakudo-2020.08.2.tar.gz and rakudo-2020.09.tar.gz

About: Rakudo is a compiler for the Perl 6 programming language.

Supply-coercers.pm6  (rakudo-2020.08.2):Supply-coercers.pm6  (rakudo-2020.09)
skipping to change at line 595 skipping to change at line 595
} }
} }
} }
} }
multi method head(Supply:D: \limit) { multi method head(Supply:D: \limit) {
nqp::istype(limit,Whatever) || limit == Inf nqp::istype(limit,Whatever) || limit == Inf
?? self ?? self
!! limit <= 0 !! limit <= 0
?? supply { } ?? supply { }
!! supply { !! supply {
my int $todo = limit.Int + 1; my int $todo = limit.Int;
whenever self -> \val { --$todo ?? emit(val) !! done } whenever self -> \val {
emit(val);
done unless --$todo;
}
} }
} }
multi method tail(Supply:D:) { multi method tail(Supply:D:) {
supply { supply {
my $last; my $last;
whenever self -> \val { whenever self -> \val {
$last := val; $last := val;
LAST emit $last; LAST emit $last;
} }
 End of changes. 1 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)