From 7f5f4c348ac2e61bfb11b1635c54893d06afa048 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 15 Feb 2018 14:46:57 -0800 Subject: [PATCH] english: use join-with. --- basis/english/english.factor | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/basis/english/english.factor b/basis/english/english.factor index 891edffb32..ae2de23d69 100644 --- a/basis/english/english.factor +++ b/basis/english/english.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2015, 2018 John Benediktsson ! See http://factorcode.org/license.txt for BSD license -USING: arrays accessors assocs assocs.extras combinators fry formatting kernel -literals locals math math.parser sequences splitting words unicode ; -USE: help.markup +USING: accessors arrays assocs assocs.extras combinators +help.markup kernel literals locals math math.parser sequences +sequences.extras splitting unicode words ; IN: english @@ -169,11 +169,7 @@ PRIVATE> dup singular? [ a/an ] [ drop "the" ] if ; : comma-list ( parts conjunction -- clause-seq ) - [ - V{ } clone [ - [ '[ ", " _ push ] ] [ '[ _ push ] ] bi interleave - ] keep { } like - ] dip over length dup 3 >= [ + [ ", " join-with ] dip over length dup 3 >= [ [ 3 > ", " " " ? " " surround ] [ 2 - pick set-nth ] bi ] [ 2drop ] if ;