]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/channels/examples/examples.factor
core, basis, extra: Remove DOS line endings from files.
[factor.git] / basis / channels / examples / examples.factor
index 4b48d7923c6ebbc7d784aac64bc2f6ca55fc9abb..8aec6f593522951a37cf721e4660278891cee03b 100644 (file)
@@ -8,12 +8,12 @@ IN: channels.examples
 
 : (counter) ( channel n -- )
     [ swap to ] 2keep 1 + (counter) ;
-    
+
 : counter ( channel -- )
-    2 (counter) ;    
+    2 (counter) ;
 
 : counter-test ( -- n1 n2 n3 )
-    <channel> dup [ counter ] curry "Counter" spawn drop 
+    <channel> dup [ counter ] curry "Counter" spawn drop
     [ from ] keep [ from ] keep from ;
 
 : filter ( send prime recv -- )
@@ -21,7 +21,7 @@ IN: channels.examples
     #! filters out all those divisible by 'prime',
     #! and sends to the 'recv' channel.
     [
-        from swap dupd mod zero? not [ swap to ] [ 2drop ] if     
+        from swap dupd mod zero? not [ swap to ] [ 2drop ] if
     ] 3keep filter ;
 
 :: (sieve) ( prime c -- )
@@ -31,14 +31,14 @@ IN: channels.examples
     [ newc p c filter ] "Filter" spawn drop
     prime newc (sieve) ;
 
-: sieve ( prime -- ) 
+: sieve ( prime -- )
     #! Send prime numbers to 'prime' channel
     <channel> dup [ counter ] curry "Counter" spawn drop
     (sieve) ;
 
 : sieve-test ( -- seq )
     <channel> dup [ sieve ] curry "Sieve" spawn drop
-    V{ } clone swap 
+    V{ } clone swap
     [ from swap push ] 2keep
     [ from swap push ] 2keep
     [ from swap push ] 2keep