]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/channels/channels.factor
threads: simplify 'suspend' combinator
[factor.git] / basis / channels / channels.factor
index 0eb7881f95915c9c336ba09400e731ac2aaf1d1f..870085f77afbee1540475f5d3293a5d6892212b0 100644 (file)
@@ -17,7 +17,7 @@ GENERIC: from ( channel -- value )
 <PRIVATE
 
 : wait ( channel -- )
-    [ senders>> push ] curry
+    [ self ] dip senders>> push
     "channel send" suspend drop ;
 
 : (to) ( value receivers -- )
@@ -36,7 +36,7 @@ M: channel to ( value channel -- )
     [ 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 ;