<PRIVATE
: wait ( channel -- )
- [ senders>> push ] curry
+ [ self ] dip senders>> push
"channel send" suspend drop ;
: (to) ( value receivers -- )
[ dup wait to ] [ nip (to) ] if-empty ;
M: channel from ( channel -- value )
- [
- notify senders>>
- [ (from) ] unless-empty
- ] curry "channel receive" suspend ;
+ [ self ] dip
+ notify senders>>
+ [ (from) ] unless-empty
+ "channel receive" suspend ;