Last active
April 26, 2016 12:32
-
-
Save jlongster/57ad73756529a5dcc4de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
operator (<~) 49 | |
{ $channel } => #{ yield csp.take($channel) } | |
operator (~>) 50 right | |
{ $value, $channel } => #{ yield csp.put($channel, $value) } | |
macro (<~alts) { | |
rule { } => { | |
yield csp.alts | |
} | |
} | |
// examples: | |
var ch = chan(); | |
var x = <~ ch | |
// var x = yield csp.take(ch) | |
5 ~> ch | |
// yield csp.put(ch, 5) | |
(<~ foo()) ~> ch | |
// yield csp.put(ch, yield csp.take(foo())) | |
var r = <~alts([ch1, ch2]) | |
// var r = yield csp.alts([ch1, ch2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sweetjs?