simple-flat-file: factor out drop-comment word.

char-rename
John Benediktsson 2017-02-02 16:39:56 -08:00
parent b93bc1ac5e
commit 7e9cd45624
1 changed files with 4 additions and 1 deletions

View 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 ;