]> gitweb.factorcode.org Git - factor.git/commitdiff
simple-flat-file: factor out drop-comment word.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 3 Feb 2017 00:39:56 +0000 (16:39 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 3 Feb 2017 00:39:56 +0000 (16:39 -0800)
basis/simple-flat-file/simple-flat-file.factor

index c8caaed651883084ac6777fef8afd72942022b08..ebcb9580ca66c87a21a3e8a1950ce445f8657abf 100644 (file)
@@ -5,8 +5,11 @@ io.encodings.utf8 io.files kernel math.parser sequences sets
 splitting ;
 IN: simple-flat-file
 
+: drop-comment ( line -- line' )
+    dup [ "#@" member? ] find drop [ head ] when* ;
+
 : drop-comments ( seq -- newseq )
-    [ dup [ "#@" member? ] find drop [ head ] when* ] map harvest ;
+    [ drop-comment ] map harvest ;
 
 : split-column ( line -- columns )
     " \t" split harvest 2 short head 2 f pad-tail ;