strings.tables: use [ max ] map-reduce
parent
abb6c01a62
commit
dd4aea9ca8
|
@ -1,13 +1,13 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel sequences fry ;
|
USING: kernel sequences fry math.order ;
|
||||||
IN: strings.tables
|
IN: strings.tables
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: format-column ( seq ? -- seq )
|
: format-column ( seq ? -- seq )
|
||||||
[
|
[
|
||||||
dup [ length ] map supremum
|
dup [ length ] [ max ] map-reduce
|
||||||
'[ _ CHAR: \s pad-tail ] map
|
'[ _ CHAR: \s pad-tail ] map
|
||||||
] unless ;
|
] unless ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue