]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/rosetta-code/align-columns/align-columns.factor
factor: trim using lists
[factor.git] / extra / rosetta-code / align-columns / align-columns.factor
index 7c9817c2f64ebeb0de374d588ff8a1c6bf46afa2..ea44667ca843ab0dcb084b8503021941089eaadd 100644 (file)
@@ -1,7 +1,6 @@
 ! Copyright (c) 2012 Anonymous
 ! See http://factorcode.org/license.txt for BSD license.
-USING: fry io kernel math math.functions math.order sequences
-splitting strings ;
+USING: io kernel math math.functions sequences splitting strings ;
 IN: rosetta.align-columns
 
 ! http://rosettacode.org/wiki/Align_columns
@@ -44,7 +43,7 @@ Further,$allow$for$each$word$in$a$column$to$be$either$left$
 justified,$right$justified,$or$center$justified$within$its$column."
 
 : split-and-pad ( text -- lines )
-    "\n" split [ "$" split harvest ] map
+    split-lines [ "$" split harvest ] map
     dup longest length
     '[ _ "" pad-tail ] map ;