]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/benchmark/fannkuch/fannkuch.factor
factor: trim using lists
[factor.git] / extra / benchmark / fannkuch / fannkuch.factor
index 218aa9fd2af78366eb17d8b7bebfe4564861adbf..4f10e20a0f56fc1ffbfede3f8365dc7b997ca24c 100644 (file)
@@ -1,12 +1,12 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel fry math math.combinatorics math.order sequences
+USING: kernel math math.combinatorics math.order sequences
 io prettyprint ;
 IN: benchmark.fannkuch
 
 : count ( quot: ( -- ? ) -- n )
-    #! Call quot until it returns false, return number of times
-    #! it was true
+    ! Call quot until it returns false, return number of times
+    ! it was true
     [ 0 ] dip '[ _ dip swap [ [ 1 + ] when ] keep ] loop ; inline
 
 : count-flips ( perm -- flip# )
@@ -24,7 +24,7 @@ IN: benchmark.fannkuch
 
 : fannkuch ( n -- )
     [
-        [ 0 0 ] dip iota [ 1 + ] B{ } map-as
+        [ 0 0 ] dip <iota> [ 1 + ] B{ } map-as
         [ fannkuch-step ] each-permutation nip
     ] keep
     "Pfannkuchen(" write pprint ") = " write . ;