Skip to content

Commit

Permalink
Fix TAB pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Nov 20, 2013
1 parent 73f60f7 commit 724cff7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions S17-concurrency.pod
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,11 @@ the C<tap> method on it. This takes up to three callables as
arguments, the optional ones expresses as named arguments:

$supply.tap: -> $value { say "Got a $value" },
done => { say "Reached the end" },
done => { say "Reached the end" },
catch => {
when X::FooBar { die "Major oopsie" };
default { warn "Supply shut down early: $_" }
}
when X::FooBar { die "Major oopsie" };
default { warn "Supply shut down early: $_" }
};

The first, known as C<more>, is invoked whenever a value is produced by the
thing that has been tapped. The second, known as C<done>, is invoked
Expand Down Expand Up @@ -642,7 +642,7 @@ Conjecture: this is going to end up looking more like:
method zip(Supply $a, Supply $b, &with = &infix:<,>) {
my @as;
my @bs;
combine $a, $b -> $out {
combine $a, $b -> $out {
more * {
($:k ?? @bs !! @as).push($_);
if @as && @bs {
Expand All @@ -655,8 +655,8 @@ Conjecture: this is going to end up looking more like:
or even:

method zip(*@in, :&with = &infix:<,>) {
my @streams = [] xx @in;
combine @in -> $out {
my @streams = [] xx @in;
combine @in -> $out {
more * {
@streams[$:k].push($_);
if all @streams».elems > 0 {
Expand Down Expand Up @@ -702,9 +702,9 @@ or conjecturally:

method merge(*@ins) {
my $done = 0;
combine @ins -> $out {
more * { $out.more($_) }
done * { $out.done() if ++$done == +@ins; }
combine @ins -> $out {
more * { $out.more($_) }
done * { $out.done() if ++$done == +@ins; }
}
}

Expand Down

0 comments on commit 724cff7

Please sign in to comment.