Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S17 is confused about callbacks and 'close' vs. 'done' and positional vs. named #77

Open
moritz opened this issue Dec 22, 2014 · 1 comment

Comments

@moritz
Copy link
Contributor

moritz commented Dec 22, 2014

S17 has these two examples:

$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.

moritz added a commit that referenced this issue Feb 10, 2015
@moritz
Copy link
Contributor Author

moritz commented Feb 10, 2015

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant