english: use join-with.
parent
58e77d10f9
commit
7f5f4c348a
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2015, 2018 John Benediktsson
|
! Copyright (C) 2015, 2018 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license
|
! See http://factorcode.org/license.txt for BSD license
|
||||||
USING: arrays accessors assocs assocs.extras combinators fry formatting kernel
|
USING: accessors arrays assocs assocs.extras combinators
|
||||||
literals locals math math.parser sequences splitting words unicode ;
|
help.markup kernel literals locals math math.parser sequences
|
||||||
USE: help.markup
|
sequences.extras splitting unicode words ;
|
||||||
|
|
||||||
IN: english
|
IN: english
|
||||||
|
|
||||||
|
@ -169,11 +169,7 @@ PRIVATE>
|
||||||
dup singular? [ a/an ] [ drop "the" ] if ;
|
dup singular? [ a/an ] [ drop "the" ] if ;
|
||||||
|
|
||||||
: comma-list ( parts conjunction -- clause-seq )
|
: comma-list ( parts conjunction -- clause-seq )
|
||||||
[
|
[ ", " join-with ] dip over length dup 3 >= [
|
||||||
V{ } clone [
|
|
||||||
[ '[ ", " _ push ] ] [ '[ _ push ] ] bi interleave
|
|
||||||
] keep { } like
|
|
||||||
] dip over length dup 3 >= [
|
|
||||||
[ 3 > ", " " " ? " " surround ] [ 2 - pick set-nth ] bi
|
[ 3 > ", " " " ? " " surround ] [ 2 - pick set-nth ] bi
|
||||||
] [ 2drop ] if ;
|
] [ 2drop ] if ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue