You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$supply.tap: -> $value { say "Got a $value" },
done => { say "Reached the end" },
quit => {
when X::FooBar { die "Major oopsie" };
default { warn "Supply shut down early: $_" }
}
and
my $t2 = $s.tap({ say 2 * $_ },
{ say "End" });
The first one suggests that there is one positional parameter to Supply.tap, but the second implies two positionals. Which one is it?
Also it seems that Channels and Taps are closed, but Supplies are done. If this is intentional, it should be made abundantly clear what the semantic difference is.
The text was updated successfully, but these errors were encountered:
@jnthn said on #perl6: Supply.done is for the producer to signal the end of the stream, .close is for the tap (not the supply) to indicate that it doesn't want more values.
By analogy, shutting down a channel should be done with Channel.done, IMHO.
S17 has these two examples:
and
The first one suggests that there is one positional parameter to Supply.tap, but the second implies two positionals. Which one is it?
Also it seems that Channels and Taps are
closed, but Supplies aredone. If this is intentional, it should be made abundantly clear what the semantic difference is.The text was updated successfully, but these errors were encountered: