]> gitweb.factorcode.org Git - factor.git/commitdiff
english: use join-with.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 15 Feb 2018 22:46:57 +0000 (14:46 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 15 Feb 2018 22:46:57 +0000 (14:46 -0800)
basis/english/english.factor

index 891edffb32df12f560f1e07d7af5047e1db1b1e1..ae2de23d6991deb88ab8b4cafbb6ee540d783833 100644 (file)
@@ -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 ;