]> gitweb.factorcode.org Git - factor.git/commitdiff
make fasta work again
authorDoug Coleman <erg@jobim.local>
Sun, 26 Apr 2009 05:45:03 +0000 (00:45 -0500)
committerDoug Coleman <erg@jobim.local>
Sun, 26 Apr 2009 05:45:03 +0000 (00:45 -0500)
extra/benchmark/fasta/fasta.factor

index 2ae5ada8a1ca5afe9bdcce1e7b8384e419613219..f457b90c309fe7b1d12d517e94db7afd9e3359fb 100755 (executable)
@@ -46,8 +46,8 @@ CONSTANT: homo-sapiens
     }
 
 : make-cumulative ( freq -- chars floats )
-    dup keys >byte-array
-    swap values >double-array unclip [ + ] accumulate swap suffix ;
+    [ keys >byte-array ]
+    [ values >double-array ] bi unclip [ + ] accumulate swap suffix ;
 
 :: select-random ( seed chars floats -- seed elt )
     floats seed random -rot
@@ -55,7 +55,7 @@ CONSTANT: homo-sapiens
     chars nth-unsafe ; inline
 
 : make-random-fasta ( seed len chars floats -- seed )
-    [ rot drop select-random ] 2curry B{ } map-as print ; inline
+    [ rot drop select-random ] 2curry "" map-as print ; inline
 
 : write-description ( desc id -- )
     ">" write write bl print ; inline
@@ -71,7 +71,7 @@ CONSTANT: homo-sapiens
 
 :: make-repeat-fasta ( k len alu -- k' )
     [let | kn [ alu length ] |
-        len [ k + kn mod alu nth-unsafe ] B{ } map-as print
+        len [ k + kn mod alu nth-unsafe ] "" map-as print
         k len +
     ] ; inline