]> gitweb.factorcode.org Git - factor.git/commitdiff
core: Add words/unwords/unwords-as and use them.
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 20 Dec 2021 20:54:15 +0000 (14:54 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 20 Dec 2021 20:54:15 +0000 (14:54 -0600)
Related to #2140

98 files changed:
basis/bootstrap/stage2.factor
basis/calendar/format/format.factor
basis/compiler/cfg/debugger/debugger.factor
basis/compiler/cfg/instructions/syntax/syntax-docs.factor
basis/db/postgresql/lib/lib.factor
basis/db/sqlite/sqlite-tests.factor
basis/documents/documents.factor
basis/farkup/farkup.factor
basis/formatting/formatting.factor
basis/ftp/client/listing-parser/listing-parser.factor
basis/furnace/actions/actions.factor
basis/furnace/chloe-tags/chloe-tags.factor
basis/gobject-introspection/gobject-introspection.factor
basis/help/html/html.factor
basis/help/markup/markup.factor
basis/help/search/search.factor
basis/help/vocabs/vocabs.factor
basis/http/client/client-tests.factor
basis/http/http.factor
basis/http/server/requests/requests-tests.factor
basis/http/server/server-tests.factor
basis/io/encodings/gb18030/gb18030.factor
basis/io/encodings/iana/iana.factor
basis/io/launcher/windows/windows.factor
basis/logging/analysis/analysis.factor
basis/logging/parser/parser.factor
basis/math/primes/factors/factors.factor
basis/opengl/capabilities/capabilities.factor
basis/present/present.factor
basis/strings/tables/tables.factor
basis/tools/deploy/backend/backend.factor
basis/tools/files/files.factor
basis/tools/ps/macosx/macosx.factor
basis/tools/scaffold/scaffold.factor
basis/ui/gadgets/editors/editors.factor
basis/ui/gadgets/labels/labels.factor
basis/ui/gadgets/panes/panes.factor
basis/ui/gadgets/tables/tables.factor
basis/ui/tools/listener/listener.factor
basis/unicode/collation/collation-tests.factor
basis/unicode/collation/collation.factor
basis/unicode/data/data.factor
basis/unicode/normalize/normalize-tests.factor
basis/unix/linux/proc/proc.factor
basis/windows/opengl32/opengl32.factor
basis/wrap/strings/strings.factor
core/classes/intersection/intersection.factor
core/classes/mixin/mixin-tests.factor
core/classes/tuple/parser/parser-tests.factor
core/classes/union/union.factor
core/parser/parser-tests.factor
core/sequences/sequences-tests.factor
core/splitting/splitting-tests.factor
core/splitting/splitting.factor
extra/99-bottles/99-bottles.factor
extra/benchmark/chameneos-redux/chameneos-redux.factor
extra/benchmark/unicode/unicode.factor
extra/brainfuck/brainfuck-tests.factor
extra/bunny/model/model.factor
extra/combinators/extras/extras-tests.factor
extra/compiler/cfg/gvn/testing/testing.factor
extra/cpu/8080/emulator/emulator.factor
extra/cuda/devices/devices.factor
extra/euler/b-rep/io/obj/obj.factor
extra/geo-ip/geo-ip.factor
extra/git/git.factor
extra/gpu/shaders/shaders.factor
extra/imap/imap.factor
extra/irc/messages/base/base.factor
extra/irc/messages/messages.factor
extra/irc/messages/parser/parser.factor
extra/lcd/lcd.factor
extra/mason/git/git.factor
extra/mason/report/report.factor
extra/math/text/french/french.factor
extra/metar/metar.factor
extra/modern/html/html.factor
extra/morse/morse.factor
extra/pcre/ffi/ffi-tests.factor
extra/pdf/layout/layout.factor
extra/pdf/values/values.factor
extra/poker/poker.factor
extra/pop3/pop3.factor
extra/project-euler/067/067.factor
extra/python/syntax/syntax-tests.factor
extra/quiz/quiz.factor
extra/rosetta-code/amb/amb.factor
extra/rosetta-code/sierpinski-triangle/sierpinski-triangle.factor
extra/rosetta-code/text-processing/max-licenses/max-licenses.factor
extra/rpn/rpn.factor
extra/smalltalk/printer/printer.factor
extra/subrip-subtitles/subrip-subtitles.factor
extra/text-to-pdf/text-to-pdf.factor
extra/text-to-speech/text-to-speech.factor
extra/tools/echo/echo.factor
extra/txon/txon.factor
extra/webapps/mason/version/binary/binary.factor
extra/zeromq/examples/wuclient.factor

index 3ec202482745c14525492288846fa7382dff574e..5ab2776d78971063e1155ca04e67281700f626fb 100644 (file)
@@ -29,7 +29,7 @@ SYMBOL: bootstrap-time
     "bootstrap." prepend require ;
 
 : load-components ( -- )
-    "include" "exclude" [ get-global " " split harvest ] bi@ diff
+    "include" "exclude" [ get-global words harvest ] bi@ diff
     [ load-component ] each ;
 
 : print-time ( us -- )
index 016f49963fc5d7a3438c1daa693a24046cb6daa9..f5a57d7f2ad622d1d2950a95711753fe0764a1c0 100644 (file)
@@ -73,7 +73,7 @@ M: timestamp day.
     [ number>string ] [ month-name ] bi* swap " " glue 20 center. ;
 
 : days-header. ( -- )
-    day-abbreviations2 " " join print ;
+    day-abbreviations2 unwords print ;
 
 : days. ( year month -- )
     [ 1 (day-of-week) dup [ "   " write ] times ]
@@ -238,7 +238,7 @@ M: integer elapsed-time
             [ first [ /mod ] [ dup ] if* ] [ second ] bi swap
             dup 0 > [ number>string prepend , ] [ 2drop ] if
         ] each drop
-    ] { } make [ "0s" ] [ reverse " " join ] if-empty ;
+    ] { } make [ "0s" ] [ reverse unwords ] if-empty ;
 
 M: real elapsed-time
     >integer elapsed-time ;
index 884be50db7f16a655fac4903da4e35fc89ab7834..debb2489964aa8884a5be0d37abfd42400d661c1 100644 (file)
@@ -1,13 +1,14 @@
 ! Copyright (C) 2008, 2011 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs classes.tuple compiler.cfg
-compiler.cfg.builder compiler.cfg.finalization compiler.cfg.gc-checks
-compiler.cfg.instructions compiler.cfg.linearization
-compiler.cfg.optimizer compiler.cfg.registers
-compiler.cfg.representations compiler.cfg.save-contexts
-compiler.cfg.utilities compiler.tree.builder compiler.tree.optimizer
-formatting fry io kernel math namespaces prettyprint quotations
-sequences strings words ;
+compiler.cfg.builder compiler.cfg.finalization
+compiler.cfg.gc-checks compiler.cfg.instructions
+compiler.cfg.linearization compiler.cfg.optimizer
+compiler.cfg.registers compiler.cfg.representations
+compiler.cfg.save-contexts compiler.cfg.utilities
+compiler.tree.builder compiler.tree.optimizer formatting io
+kernel math namespaces prettyprint quotations sequences
+splitting strings words ;
 IN: compiler.cfg.debugger
 
 GENERIC: test-builder ( quot -- cfgs )
@@ -53,7 +54,7 @@ M: ##phi insn.
 M: insn insn. ( insn -- )
     tuple>array unclip-last insn-number. [
         dup string? [ ] [ unparse ] if
-    ] map " " join write nl ;
+    ] map unwords write nl ;
 
 : block-header. ( bb -- )
     [ number>> ] [ kill-block?>> "(k)" "" ? ] bi
index 856b927bb05518610d9a3929ed620ec3881b2da9..990e1e05ba4f94c30a33c2a2181b11b13a1193e0 100644 (file)
@@ -4,7 +4,7 @@ IN: compiler.cfg.instructions.syntax
 <<
 STRING: parse-insn-slot-specs-code
 USING: compiler.cfg.instructions.syntax prettyprint splitting ;
-"use: src/int-rep temp: temp/int-rep" " " split parse-insn-slot-specs .
+"use: src/int-rep temp: temp/int-rep" words parse-insn-slot-specs .
 ;
 
 STRING: parse-insn-slot-specs-result
index b56ad0bc11788d1e46dfc5241d7ab3ea76f465ab..10db939b2a0f121457253c04474ebad5bc06635c 100644 (file)
@@ -21,7 +21,7 @@ IN: db.postgresql.lib
 
 : (postgresql-error-message) ( handle -- str )
     PQerrorMessage
-    "\n" split [ [ blank? ] trim ] map "\n" join ;
+    "\n" split [ [ blank? ] trim ] map unlines ;
 
 : postgresql-error-message ( -- str )
     db-connection get handle>> (postgresql-error-message) ;
index d9ad216db6a9232c931ae160a3b7c962e31acaec..c339e641aa369c8f1d9d58a8911f0f87729a0d20 100644 (file)
@@ -5,7 +5,7 @@ math.parser namespaces sequences sorting splitting tools.test ;
 IN: db.sqlite.tests
 
 : normalize ( str -- str' )
-    " \n" split harvest " " join ;
+    " \n" split harvest unwords ;
 
 ! delete-trigger-restrict
 ${
index b435a2337587566a5b592314742bf5f47f1aebec..a8d553e86074cbf1c1039c0319388ae546fee54a 100644 (file)
@@ -117,7 +117,7 @@ PRIVATE>
 
 :: doc-range ( from to document -- string )
     from to [ [ from to ] dip document (doc-range) ] map-lines
-    "\n" join ;
+    unlines ;
 
 : add-undo ( edit document -- )
     dup inside-undo?>> [ 2drop ] [
index 3d4587b76293f609ff012daf521435f391591b85..879fab36ed0cd5242cf9066eb7db9eb2fec7786b 100644 (file)
@@ -108,7 +108,7 @@ DEFER: (parse-paragraph)
     [ cut-slice ] [ f ] if* swap ;
 
 :: (take-until) ( state delimiter accum -- string/f state' )
-    state empty? [ accum "\n" join f ] [
+    state empty? [ accum unlines f ] [
         state unclip-slice :> ( rest first )
         first delimiter split1 :> ( before after )
         before accum push
index 6141a8552f7195e03748e8889b515bb5a2d5cca1..494acbb448a0fc139196f56af1f7d6c28e14e149 100644 (file)
@@ -201,7 +201,7 @@ MACRO: sprintf ( format-string -- quot )
           [ >time ]
           [ year>> number>string ]
        } cleave
-    ] output>array " " join ; inline
+    ] output>array unwords ; inline
 
 : week-of-year ( timestamp day -- n )
     [ dup clone 1 >>month 1 >>day day-of-week dup ] dip > [ 7 swap - ] when
index 6e2f9ebec4d38ada2a6bd37d2a5bed6ae942062f..04402cedcbdd251809281ed5949c1885cd3c9246 100644 (file)
@@ -79,7 +79,7 @@ name target ;
 
 : parse-list ( ftp-response -- ftp-response )
     dup strings>>
-    [ " " split harvest ] map
+    [ words harvest ] map
     dup length {
         { 11 [ parse-list-11 ] }
         { 9 [ parse-list-11 ] }
index 5e0a7664e0c9f5b58e769da8f70158f83d436f52..c49cc5bf36734f0f8682725ceaa4cbd6fc7fe4f0 100644 (file)
@@ -57,7 +57,7 @@ CONSTANT: revalidate-url-key "__u"
 : validation-failed ( -- * )
     post-request? revalidate-url and [
         begin-conversation
-        nested-forms-key param " " split harvest nested-forms cset
+        nested-forms-key param words harvest nested-forms cset
         form get form cset
         <continue-conversation>
     ] [ <400> ] if*
index ac8c4ce519e474468d5675bfb0d76db6d39f70f4..5052a06a15ae3f2a8ff2bfcb12793f7086226d0a 100644 (file)
@@ -66,7 +66,7 @@ CHLOE: base
     compile-a-url [ [XML <base href=<->/> XML] ] [xml-code] ;
 
 : hidden-nested-fields ( -- xml )
-    nested-forms get " " join f like nested-forms-key
+    nested-forms get unwords f like nested-forms-key
     hidden-form-field ;
 
 : render-hidden ( for -- xml )
index 760726084c3acbea1e0ee911d8aade4b7fe21068..23fb5541c7aca063d3a4589106d6edc33193d4c4 100644 (file)
@@ -11,7 +11,7 @@ ERROR: gir-not-found name paths ;
 
 M: gir-not-found summary
     [ name>> "“" "” file not found on paths:\n" surround ]
-    [ paths>> "\n" join ] bi
+    [ paths>> unlines ] bi
     "\n\nUse the existing path or declare GIR_DIRS environment variable"
     3append ;
 
index 433c467ebab420f9a9c36bb1f51a1a6dfe311f4c..c18e91025aabfea4cd681ba4b06b0a229acf825b 100644 (file)
@@ -121,7 +121,7 @@ M: pathname url-of
 : css-classes ( classes -- stylesheet )
     [
         [ css-style " { " "}" surround ] [ "." prepend ] bi* prepend
-    ] { } assoc>map "\n" join ;
+    ] { } assoc>map unlines ;
 
 :: css-styles-to-classes ( body -- stylesheet body )
     H{ } clone :> classes
index 76616e74f9f10faf21f5ec199dbe66097005de38..33ec69a033325e6bd15c7e8e9b59b01c2a6bbf06 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs combinators compiler.units
-definitions.icons effects fry hashtables help.stylesheet
-help.topics io io.styles kernel locals make math namespaces
-present prettyprint prettyprint.stylesheet quotations see
-sequences sequences.private sets sorting strings urls vocabs
+definitions.icons effects hashtables help.stylesheet help.topics
+io io.styles kernel make math namespaces present prettyprint
+prettyprint.stylesheet quotations see sequences
+sequences.private sets sorting splitting strings urls vocabs
 words words.symbol ;
 FROM: prettyprint.sections => with-pprint ;
 IN: help.markup
@@ -99,7 +99,7 @@ M: f print-element drop ;
     ] ($block) ; inline
 
 : $code ( element -- )
-    "\n" join dup <input> [ write ] ($code) ;
+    unlines dup <input> [ write ] ($code) ;
 
 : $syntax ( element -- ) "Syntax" $heading $code ;
 
@@ -122,7 +122,7 @@ M: f print-element drop ;
     "Examples" $heading print-element ;
 
 : $example ( element -- )
-    unclip-last [ "\n" join ] dip over <input> [
+    unclip-last [ unlines ] dip over <input> [
         [ print ] [ output-style get format ] bi*
     ] ($code) ;
 
index 87db04467f5b77987ce0c8ce8e5790b973e73b7a..0dab4860ac8195218aaff672093e81202c2c688f 100644 (file)
@@ -21,16 +21,16 @@ IN: help.search
             { \ $vocab-link [ second ] }
             { \ $emphasis [ second ] }
             { \ $subsection [ second article-name ] }
-            { \ $subsections [ rest [ article-name ] map " " join ] }
-            { \ $description [ rest [ element-value ] map " " join ] }
-            { \ $notes [ rest [ element-value ] map " " join ] }
-            { \ $snippet [ rest [ element-value ] map " " join ] }
+            { \ $subsections [ rest [ article-name ] map unwords ] }
+            { \ $description [ rest [ element-value ] map unwords ] }
+            { \ $notes [ rest [ element-value ] map unwords ] }
+            { \ $snippet [ rest [ element-value ] map unwords ] }
             [ 2drop f ]
         } case
     ] [ dup string? [ drop f ] unless ] if ;
 
 MEMO: article-words ( name -- words )
-    article-content [ element-value ] map " " join search-words
+    article-content [ element-value ] map unwords search-words
     [ [ digit? ] all? ] reject
     [ [ { [ letter? ] [ digit? ] } 1|| not ] trim ] map! harvest  ;
 
index 8e9fae07733e949b32e8b2313fde976ad0d7f59c..3820673d6fb032fd886963ccc811e0a91e305bf3 100644 (file)
@@ -3,11 +3,10 @@
 USING: accessors arrays assocs classes classes.builtin
 classes.intersection classes.mixin classes.predicate
 classes.singleton classes.tuple classes.union combinators
-effects fry generic help help.markup help.stylesheet
-help.topics io io.pathnames io.styles kernel macros make
-namespaces sequences sorting summary vocabs vocabs.files
-vocabs.hierarchy vocabs.loader vocabs.metadata words
-words.symbol ;
+effects generic help help.markup help.stylesheet help.topics io
+io.pathnames io.styles kernel macros make namespaces sequences
+sorting splitting summary vocabs vocabs.files vocabs.hierarchy
+vocabs.loader vocabs.metadata words words.symbol ;
 IN: help.vocabs
 
 : about ( vocab -- )
@@ -96,7 +95,7 @@ C: <vocab-author> vocab-author
         [
             [ <$pretty-link> ]
             [ superclass-of <$pretty-link> ]
-            [ "slots" word-prop [ name>> ] map " " join <$snippet> ]
+            [ "slots" word-prop [ name>> ] map unwords <$snippet> ]
             tri 3array
         ] map
         { { $strong "Class" } { $strong "Superclass" } { $strong "Slots" } } prefix
index 5d8e11aaaa0a5f00ce1561912fb168b91d26d354..e8bcb674d15007fadec74d87219284818ed1fdd2 100644 (file)
@@ -58,7 +58,7 @@ IN: http.client.tests
         "content-type: text/html; charset=UTF-8"
         "date: Wed, 12 Oct 2011 18:57:49 GMT"
         "server: Factor http.server"
-    } [ "\n" join ] [ "\r\n" join ] bi
+    } [ unlines ] [ "\r\n" join ] bi
     [ [ read-response ] with-string-reader ] same?
 ] unit-test
 
index 43420af92e2113fb05f4b9feb5e8027d464d7f6a..574f180b97d2171717632463b8bf211b53da17fe 100644 (file)
@@ -221,7 +221,7 @@ TUPLE: post-data data params content-type content-encoding ;
         swap >>content-type ;
 
 : parse-content-type-attributes ( string -- attributes )
-    " " split harvest [
+    words harvest [
         "=" split1
         "\"" ?head drop "\"" ?tail drop
     ] { } map>assoc ;
index d011cceab63125deaddd4abdf0c90d8c9c221028..abde71429489c30f6d70230382381b565c359e64 100644 (file)
@@ -155,6 +155,6 @@ hello
         "connection: close"
         "host: 127.0.0.1:55532"
         "user-agent: Factor http.client"
-    } [ "\n" join ] [ "\r\n" join ] bi
+    } [ unlines ] [ "\r\n" join ] bi
     [ string>request ] same?
 ] unit-test
index 167eb7f127bef33cf51692ac80c4e551abfdedf5..16227e333db7ec45f48e1532dde1f4810238623a 100644 (file)
@@ -38,7 +38,7 @@ io.streams.string kernel math peg sequences tools.test urls ;
         "connection: close"
         "host: 127.0.0.1:55532"
         "user-agent: Factor http.client"
-    } [ "\n" join ] [ "\r\n" join ] bi
+    } [ unlines ] [ "\r\n" join ] bi
     [ [ read-request ] with-string-reader ] same?
 ] unit-test
 
index 6198b406e980e44275fc7db85d32ea42d5c7596e..ccfa91e220cb2de4c553eab3bc390c376740938f 100644 (file)
@@ -29,7 +29,7 @@ gb18030 "GB18030" register-encoding
 TUPLE: range ufirst ulast bfirst blast ;
 
 : b>byte-array ( string -- byte-array )
-    " " split [ hex> ] B{ } map-as ;
+    words [ hex> ] B{ } map-as ;
 
 : add-range ( contained ranges -- )
     [
index 94a6a077ef8852ebcccddf07f4bc98a0b61fa6df..eeb680ea3342c7fbfe0c015dc09cd66f1d75e5cc 100644 (file)
@@ -20,7 +20,7 @@ PRIVATE>
 <PRIVATE
 : parse-iana ( file -- synonym-set )
     utf8 file-lines { "" } split [
-        [ " " split ] map
+        [ words ] map
         [ first { "Name:" "Alias:" } member? ] filter
         values { "None" } diff
     ] map harvest ;
index 613cb70f88dc82f77c30f7b7eab60b44935888b1..1b7764edc3c0ee708be95a1fb3f66bde0dfa5aac 100644 (file)
@@ -86,7 +86,7 @@ TUPLE: CreateProcess-args
     ] when ;
 
 : join-arguments ( args -- cmd-line )
-    [ escape-argument ] map " " join ;
+    [ escape-argument ] map unwords ;
 
 : lookup-priority ( process -- n )
     priority>> {
index da1df05b335dca004750da83c5f74c9b1ae443fc..31cdea1ec1cb1284a4ae6fefa230cc53c36011d0 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2008, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel sequences namespaces words assocs logging sorting
-prettyprint io io.styles io.files io.encodings.utf8
-strings combinators accessors arrays math
-logging.server logging.parser calendar.format ;
+USING: accessors arrays assocs io io.styles kernel logging
+logging.parser math namespaces prettyprint sequences sorting
+splitting ;
 IN: logging.analysis
 
 SYMBOL: word-names
@@ -57,7 +56,7 @@ SYMBOL: message-histogram
     [
         [ first name>> write bl ]
         [ second write ": " write ]
-        [ third "\n" join write ]
+        [ third unlines write ]
         tri
     ] histogram.
     nl nl
index b5417255b1ecea9df698c9325fa0966861abbd28..ecff2ef1d2fa826510a3237276025f81ca358f75 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs calendar calendar.format calendar.parser
 combinators io io.encodings.utf8 io.files kernel logging
-logging.server make namespaces peg peg.parsers prettyprint sequences
-strings vectors words ;
+logging.server make namespaces peg peg.parsers prettyprint
+sequences splitting strings vectors words ;
 IN: logging.parser
 
 TUPLE: log-entry date level word-name message ;
@@ -95,7 +95,7 @@ M: word log-timestamp. drop "multiline" write ;
         [ date>> log-timestamp. bl ]
         [ level>> pprint bl ]
         [ word-name>> write nl ]
-        [ message>> "\n" join print ]
+        [ message>> unlines print ]
     } cleave ;
 
 : log-entries. ( errors -- )
index e39e838524fadea1a7521f46167bc889dd2ebcdd..911a297ca9470e230c4ad5dc4a67ab69e98ec91a 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays assocs combinators command-line io kernel make
 math math.functions math.parser math.primes math.ranges
-namespaces sequences sequences.product sorting ;
+namespaces sequences sequences.product sorting splitting ;
 IN: math.primes.factors
 
 <PRIVATE
@@ -56,7 +56,7 @@ PRIVATE>
 : unix-factor ( string -- )
     dup string>number [
         [ ": " append write ]
-        [ factors [ number>string ] map " " join print ] bi*
+        [ factors [ number>string ] map unwords print ] bi*
     ] [
         "factor: `" "' is not a valid positive integer" surround print
     ] if* flush ;
index c7a7afc1de8430541cfd64f7d69bdc4914518bc1..479700063589bdeb8a09cda3be89ae1b0eda7e0d 100644 (file)
@@ -11,7 +11,7 @@ IN: opengl.capabilities
     over string?  [ member? ] [ [ member? ] curry any? ] if ;
 
 : gl-extensions ( -- seq )
-    GL_EXTENSIONS glGetString " " split ;
+    GL_EXTENSIONS glGetString words ;
 : has-gl-extensions? ( extensions -- ? )
     gl-extensions [ (has-extension?) ] curry all? ;
 : (make-gl-extensions-error) ( required-extensions -- )
index 22f4406a0eb85cb9dbabff32ca1e381d683caf6a..6ed7f2831eab97d37fb38f8878cb1974ca1a1379 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types effects io.pathnames kernel math
-math.parser quotations sequences strings vocabs words ;
+math.parser quotations sequences splitting strings vocabs words ;
 IN: present
 
 GENERIC: present ( object -- string )
@@ -31,7 +31,7 @@ M: pathname present string>> ;
 M: callable present
     [ "[ ]" ] [
         [ drop "[ " ]
-        [ [ present ] map " " join ]
+        [ [ present ] map unwords ]
         [ drop " ]" ] tri 3append
     ] if-empty ;
 
index c3e5aca1cbe648df29c14b57f0ed7e7167d8b812..aedaf43b857b59dc2dfd85cfdbdd8fac3dcff9e1 100644 (file)
@@ -17,5 +17,5 @@ PRIVATE>
     [ [ lines ] map format-row flip ] map concat flip
     [ { } ] [
         [ but-last-slice [ format-column ] map! drop ] keep
-        flip [ " " join ] map!
+        flip [ unwords ] map!
     ] if-empty ;
index 5e09bbcdca937e384c048522185fe7b8182338f0..597449625bfa1b7bd11e9ab743a502993c732a11 100644 (file)
@@ -68,7 +68,7 @@ ERROR: can't-deploy-library-file library ;
         [
             "-staging" , "-no-user-init" , "-pic=0" ,
             [ staging-image-name "-output-image=" prepend , ]
-            [ " " join "-include=" prepend , ] bi
+            [ unwords "-include=" prepend , ] bi
         ] [
             input-image-name "-i=" prepend ,
             "-resource-path=" "" resource-path append ,
index 262d598b52e522a5bc2a6b48b17aee93088da24f..0b5b71e476befb3d139513bd2945c92c50c89b03 100644 (file)
@@ -25,7 +25,7 @@ IN: tools.files
         dup year>> dup now year>> =
         [ drop listing-time ] [ nip number>string ] if
         5 CHAR: \s pad-head
-    ] tri 3array " " join ;
+    ] tri 3array unwords ;
 
 : read>string ( ? -- string ) "r" "-" ? ; inline
 
index a7e9d42387425d918072bbbfc2fca379c27e5ffd..eecb31cbdda86138dd086da6560debeb60ec1994 100644 (file)
@@ -139,7 +139,7 @@ STRUCT: kinfo_proc
     [ kinfo_proc memory>struct ] map ;
 
 : ps-arg ( kp_proc -- arg )
-    [ p_pid>> args rest " " join ] [
+    [ p_pid>> args rest unwords ] [
         drop p_comm>> 0 over index [ head ] when* >string
     ] recover ;
 
index 0629be1b50dd0b926f1511f6a43ad0763d62800b..48be516a25ed9fed02bcf2db302eaa1d3943df1f 100644 (file)
@@ -341,7 +341,7 @@ PRIVATE>
 SYMBOL: nested-examples
 
 : example-using ( using -- )
-    " " join "example-using" [
+    unwords "example-using" [
         nested-examples get 4 0 ? CHAR: \s <string> "example-indent" [
             "${example-indent}\"Example:\"
 ${example-indent}{ $example \"USING: ${example-using} ;\"
index 3f19c39e39b409985c2e970188a0243d4e527b1a..1973cb233370594b9c4d3fe6f54efe7a6ebcaa5f 100644 (file)
@@ -639,7 +639,7 @@ PRIVATE>
     "\n" split
     [ rest-slice [ [ blank? ] trim-head-slice ] map! drop ]
     [ but-last-slice [ [ blank? ] trim-tail-slice ] map! drop ]
-    [ " " join ]
+    [ unwords ]
     tri ;
 
 : last-line? ( document line -- ? )
index 7ba544392fb01c56feb15d1b7a572a1c370a420f..270ddc4f21a3369e22394ce698d38d0faf777020 100644 (file)
@@ -13,7 +13,7 @@ TUPLE: label < aligned-gadget text font ;
 SLOT: string
 
 M: label string>>
-    text>> dup string? [ "\n" join ] unless ; inline
+    text>> dup string? [ unlines ] unless ; inline
 
 <PRIVATE
 
index e2cf8b43144b6092ae3c614d890d63f55d5b41ba..b204610bc920e5bf058372b58b783df014fc9dd2 100644 (file)
@@ -353,7 +353,7 @@ M: paragraph pane-line
     { presented image-style } pick '[ _ key? ] any? [
         pane-text
     ] [
-        [ " " split ] 2dip
+        [ words ] 2dip
         [ pane-bl ] [ pane-text ] bi-curry bi-curry
         interleave
     ] if ;
index fd9550e9490cd6375d9c6a8f98981366b734fcd6..9a39cdc4803a3ad049dfe1fb088e3ab55bf3f60b 100644 (file)
@@ -71,7 +71,7 @@ M: f cell-dim 2drop 0 0 0 ;
 M: f draw-cell 2drop ;
 
 : single-line ( str -- str' )
-    dup [ "\r\n" member? ] any? [ lines " " join ] when ;
+    dup [ "\r\n" member? ] any? [ lines unwords ] when ;
 
 M: string cell-dim single-line text-dim first2 ceiling 0 ;
 M: string draw-cell single-line draw-text ;
index bfcfe4d8403e53198ef1b92a0826f9d0db391a78..afa2fe4f1de0525eaee70a32f0670624226572b1 100644 (file)
@@ -6,8 +6,8 @@ concurrency.mailboxes continuations destructors documents
 documents.elements fonts hashtables help help.markup help.tips
 io io.styles kernel lexer listener literals math math.vectors
 models models.arrow models.delay namespaces parser prettyprint
-sequences source-files.errors strings system threads ui
-ui.commands ui.gadgets ui.gadgets.editors ui.gadgets.glass
+sequences source-files.errors splitting strings system threads
+ui ui.commands ui.gadgets ui.gadgets.editors ui.gadgets.glass
 ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers
 ui.gadgets.status-bar ui.gadgets.toolbar ui.gadgets.tracks
 ui.gestures ui.operations ui.pens.solid ui.theme
@@ -161,7 +161,7 @@ M: interactor stream-readln
 M:: interactor stream-read-unsafe ( n buf interactor -- count )
     n [ 0 ] [
         drop
-        interactor interactor-read dup [ "\n" join ] when
+        interactor interactor-read dup [ unlines ] when
         n short [ head-slice 0 buf copy ] keep
     ] if-zero ;
 
@@ -176,7 +176,7 @@ M: interactor stream-read1
 M: interactor stream-read-until
     swap '[
         _ interactor-read [
-            "\n" join CHAR: \n suffix
+            unlines CHAR: \n suffix
             [ _ member? ] dupd find
             [ [ head ] when* ] dip dup not
         ] [ f f f ] if*
index c5d2a5e7ecab167027b952637b430cddc8fb53e6..9f57002a59e6159c806a8aad47d38bac3c8fa8b4 100644 (file)
@@ -24,19 +24,19 @@ IN: unicode.collation.tests
 
 : parse-collation-test-shifted ( -- lines )
     collation-test-lines
-    [ ";" split first " " split [ hex> ] "" map-as ] map ;
+    [ ";" split first words [ hex> ] "" map-as ] map ;
 
 : tail-from-last ( string char -- string' )
     '[ _ = ] dupd find-last drop 1 + tail ; inline
 
 : line>test-weights ( string -- pair )
     ";" split1 [
-        " " split [ hex> ] map
+        words [ hex> ] map
     ] [
         "#" split1 nip CHAR: [ tail-from-last
         "]" split1 drop
         "|" split 4 head
-        [ " " split harvest [ hex> ] map ] map
+        [ words harvest [ hex> ] map ] map
     ] bi* 2array ;
 
 ! These tests actually would pass if I didn't fix up
index d1da246d2f09511e254e769521cf71e5af1f9da7..68a155fd5b6a5011db06b052d49c3a0aea49d215 100644 (file)
@@ -25,7 +25,7 @@ TUPLE: weight-levels primary secondary tertiary ignorable? ;
     ] map ;
 
 : parse-keys ( string -- chars )
-    " " split [ hex> ] "" map-as ;
+    words [ hex> ] "" map-as ;
 
 : parse-ducet ( file -- ducet )
     load-data-file [ [ parse-keys ] [ parse-weight ] bi* ] H{ } assoc-map-as ;
index c1497d081d09cb8de208cbcd62bf94d4d5950deb..c5d3c4703c73b2f731051afba6b81ba5bd20d212 100644 (file)
@@ -100,7 +100,7 @@ PRIVATE>
 
 : (process-decomposed) ( data -- alist )
     5 swap (process-data)
-    [ " " split [ hex> ] map ] assoc-map ;
+    [ words [ hex> ] map ] assoc-map ;
 
 : exclusions-file ( -- filename )
     "vocab:unicode/UCD/CompositionExclusions.txt" ;
@@ -157,7 +157,7 @@ PRIVATE>
     ] H{ } assoc-map-as ;
 
 : multihex ( hexstring -- string )
-    " " split [ hex> ] map sift ;
+    words [ hex> ] map sift ;
 
 PRIVATE>
 
index 71f0a4f7ef31cd0aac184862a0015da69125dda1..a97fc42231e92560502627917a02804211aaba03 100644 (file)
@@ -34,7 +34,7 @@ IN: unicode.normalize.tests
     values [
         [
             "#@" split first [ CHAR: \s = ] trim-tail ";" split harvest
-            [ " " split [ hex> ] "" map-as ] map
+            [ words [ hex> ] "" map-as ] map
         ] map
     ] map concat ;
 
index c2de4270f887a3e8a421f9fb9472a24a1f31fa07..205e312e725f797018a5db69c7002e285b849879 100644 (file)
@@ -59,13 +59,13 @@ ERROR: unknown-cpuinfo-line string ;
     [ CHAR: \t = ] trim-tail [ [ CHAR: \s = ] trim ] bi@
     {
         { "address sizes" [
-            "," split [ [ CHAR: \s = ] trim " " split first string>number ] map
+            "," split [ [ CHAR: \s = ] trim words first string>number ] map
             >>address-sizes
         ] }
         { "apicid" [ string>number >>apicid ] }
         { "bogomips" [ string>number >>bogomips ] }
         { "cache size" [
-            " " split first [ CHAR: \s = ] trim
+            words first [ CHAR: \s = ] trim
             string>number 1024 * >>cache-size
         ] }
         { "cache_alignment" [ string>number >>cache-alignment ] }
@@ -78,7 +78,7 @@ ERROR: unknown-cpuinfo-line string ;
         { "cpuid level" [ string>number >>cpuid-level ] }
         { "f00f_bug" [ "yes" = >>f00f-bug? ] }
         { "fdiv_bug" [ "yes" = >>fdiv-bug? ] }
-        { "flags" [ " " split harvest >>flags ] }
+        { "flags" [ words harvest >>flags ] }
         { "fpu" [ "yes" = >>fpu? ] }
         { "fpu_exception" [ "yes" = >>fpu-exception? ] }
         { "hlt_bug" [ "yes" = >>hlt-bug? ] }
@@ -130,7 +130,7 @@ TUPLE: proc-loadavg
 
 : parse-proc-loadavg ( -- obj )
     "/proc/loadavg" utf8 file-lines first
-    " " split [
+    words [
         {
             [ string>number ]
             [ string>number ]
@@ -189,7 +189,7 @@ TUPLE: proc-meminfo
 ! Different kernels have fewer fields. Make sure we have enough.
 : parse-proc-meminfo ( -- meminfo )
     "/proc/meminfo" utf8 file-lines
-    [ " " split harvest second string>number 1024 * ] map
+    [ words harvest second string>number 1024 * ] map
     proc-meminfo "slots" word-prop length f pad-tail
     [ proc-meminfo boa ] input<sequence ;
 
@@ -220,7 +220,7 @@ TUPLE: proc-cpu-stat name user nice system idle iowait irq softirq steal guest g
         [ second [ line>cpu ] map ]
         [
             third
-            [ " " split1 nip " " split [ string>number ] map ] map
+            [ " " split1 nip words [ string>number ] map ] map
             [
                 {
                     [ ]
@@ -275,7 +275,7 @@ TUPLE: proc-uptime up idle ;
 
 : parse-proc-uptime ( -- uptime )
     "/proc/uptime" utf8 file-lines first
-    " " split first2 [ string>number seconds ] bi@
+    words first2 [ string>number seconds ] bi@
     proc-uptime boa ;
 
 ! /proc/pid/*
@@ -334,7 +334,7 @@ TUPLE: pid-stat pid filename state parent-pid group-id session-id terminal#
 : parse-proc-pid-stat ( pid -- stat )
     "stat" proc-pid-path
     proc-first-line
-    " " split harvest
+    words harvest
     pid-stat "slots" word-prop length "0" pad-tail
     [ dup string>number [ nip ] when* ] map
     [ pid-stat boa ] input<sequence ;
index 5ddf7450b5f7cc484f4b9bbe3851d375ff1e3665..2b91aeffb80a0baaafab4bc651c3ab660ff6bf5b 100644 (file)
@@ -156,7 +156,7 @@ CONSTANT: WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
     "wglGetExtensionsStringARB" wglGetProcAddress >boolean ;
 
 : wgl-extensions ( hdc -- extensions )
-    has-wglGetExtensionsStringARB? [ wglGetExtensionsStringARB " " split ] [ drop { } ] if ;
+    has-wglGetExtensionsStringARB? [ wglGetExtensionsStringARB words ] [ drop { } ] if ;
 
 : has-wgl-extensions? ( hdc extensions -- ? )
     swap wgl-extensions [ member? ] curry all? ;
index 46e8b792b7909699bbf691bf5cb0f1566ffffe07..ddfd053900fd949ea652e516a41c3115d52c336a 100644 (file)
@@ -15,10 +15,10 @@ IN: wrap.strings
     lines [ split-line ] map! ;
 
 : join-elements ( wrapped-lines -- lines )
-    [ " " join ] map! ;
+    [ unwords ] map! ;
 
 : join-lines ( strings -- string )
-    "\n" join ;
+    unlines ;
 
 PRIVATE>
 
index bd18ca61b65c139c3c8b8e4e3c4d886d123b729d..691006c21138209ead733bcfc867512889750519 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs classes classes.algebra
 classes.algebra.private classes.builtin classes.private
-combinators kernel make sequences words ;
+combinators kernel make sequences splitting words ;
 IN: classes.intersection
 
 PREDICATE: intersection-class < class
@@ -52,7 +52,7 @@ M: anonymous-intersection (flatten-class)
     ] if-empty ;
 
 M: anonymous-intersection class-name
-    participants>> [ class-name ] map " " join ;
+    participants>> [ class-name ] map unwords ;
 
 PRIVATE>
 
index c8e48888d86528a13768fc37edc330c351c0ba76..5c40dccd84852804e15fe4e5fc54a365d7f3fbd8 100644 (file)
@@ -60,7 +60,7 @@ USE: io.streams.string
             "INSTANCE: sequence mixin-forget-test"
             "GENERIC: mixin-forget-test-g ( x -- y )"
             "M: mixin-forget-test mixin-forget-test-g ;"
-        } "\n" join <string-reader> "mixin-forget-test"
+        } unlines <string-reader> "mixin-forget-test"
         parse-stream drop
     ] unit-test
 
@@ -75,7 +75,7 @@ USE: io.streams.string
             "INSTANCE: hashtable mixin-forget-test"
             "GENERIC: mixin-forget-test-g ( x -- y )"
             "M: mixin-forget-test mixin-forget-test-g ;"
-        } "\n" join <string-reader> "mixin-forget-test"
+        } unlines <string-reader> "mixin-forget-test"
         parse-stream drop
     ] unit-test
 
index 2f410c221b25c8a8e45e0cdc03b079e7c7943bd6..836dc4c8b03f4452bce08b63e552d86d1ba311dd 100644 (file)
@@ -107,7 +107,7 @@ TUPLE: parsing-corner-case x ;
         "    f"
         "    3"
         "}"
-    } "\n" join eval( -- tuple )
+    } unlines eval( -- tuple )
 ] unit-test
 
 { T{ parsing-corner-case f 3 } } [
@@ -116,7 +116,7 @@ TUPLE: parsing-corner-case x ;
         "T{ parsing-corner-case"
         "    { x 3 }"
         "}"
-    } "\n" join eval( -- tuple )
+    } unlines eval( -- tuple )
 ] unit-test
 
 { T{ parsing-corner-case f 3 } } [
@@ -125,7 +125,7 @@ TUPLE: parsing-corner-case x ;
         "T{ parsing-corner-case {"
         "    x 3 }"
         "}"
-    } "\n" join eval( -- tuple )
+    } unlines eval( -- tuple )
 ] unit-test
 
 
@@ -133,14 +133,14 @@ TUPLE: parsing-corner-case x ;
     {
         "USE: classes.tuple.parser.tests T{ parsing-corner-case"
         "    { x 3 }"
-    } "\n" join eval( -- tuple )
+    } unlines eval( -- tuple )
 ] [ error>> unexpected-eof? ] must-fail-with
 
 [
     {
         "USE: classes.tuple.parser.tests T{ parsing-corner-case {"
         "    x 3 }"
-    } "\n" join eval( -- tuple )
+    } unlines eval( -- tuple )
 ] [ error>> unexpected-eof? ] must-fail-with
 
 TUPLE: bad-inheritance-tuple ;
index 9f9afe20a8b4e5733e878f98f1705976a90435c7..b292640417179eab1156cbecef16550bbf18e4b2 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors assocs classes classes.algebra
 classes.algebra.private classes.builtin classes.private
 classes.tuple classes.tuple.private combinators definitions
 kernel kernel.private math math.private quotations sequences
-slots.private sorting words ;
+slots.private sorting splitting words ;
 IN: classes.union
 
 PREDICATE: union-class < class
@@ -117,7 +117,7 @@ M: anonymous-union instance?
     members>> [ instance? ] with any? ;
 
 M: anonymous-union class-name
-    members>> [ class-name ] map " " join ;
+    members>> [ class-name ] map unwords ;
 
 M: union-class normalize-class
     class-members <anonymous-union> normalize-class ;
index 58ea85917bbf045b9c091296091b8db1a1ca3dfe..7d17a58dfa34777b6f61103d09fea356a051ac04 100644 (file)
@@ -431,7 +431,7 @@ DEFER: foo
         "GENERIC: change-combination ( obj a -- b )"
         "M: integer change-combination 2drop 1 ;"
         "M: array change-combination 2drop 2 ;"
-    } "\n" join <string-reader> "change-combination-test" parse-stream drop
+    } unlines <string-reader> "change-combination-test" parse-stream drop
 ] unit-test
 
 { } [
@@ -441,7 +441,7 @@ DEFER: foo
         "GENERIC#: change-combination 1 ( obj a -- b )"
         "M: integer change-combination 2drop 1 ;"
         "M: array change-combination 2drop 2 ;"
-    } "\n" join <string-reader> "change-combination-test" parse-stream drop
+    } unlines <string-reader> "change-combination-test" parse-stream drop
 ] unit-test
 
 { 2 } [
index 61ca2d6e802a3ede954663fe1c968315c2290c67..9acdf6e0b166dea4714d13583006cbeba3e319d7 100644 (file)
@@ -96,7 +96,7 @@ IN: sequences.tests
 { 4 V{ 1 2 3 } } [ 4 V{ 1 4 2 5 3 6 } [ dupd > ] filter! ] unit-test
 
 { "hello world how are you" }
-[ { "hello" "world" "how" "are" "you" } " " join ] unit-test
+[ { "hello" "world" "how" "are" "you" } unwords ] unit-test
 
 { "hello world how are you" }
 [ { "hello" "world" "how" "are" "you" } " " "" join-as ] unit-test
index 7285ce20df9dfa35bc82d7bc2121403e05907713..2c676545715f82c7b25e89452139a4c1db3f0aa4 100644 (file)
@@ -24,21 +24,21 @@ USING: ascii kernel math sequences splitting strings tools.test ;
 { "Beginning and end" f } [ "Beginning and end" "eginning " ?tail ] unit-test
 
 { { "This" "is" "a" "split" "sentence" } }
-[ "This is a split sentence" " " split ]
+[ "This is a split sentence" words ]
 unit-test
 
 { { "OneWord" } }
-[ "OneWord" " " split ]
+[ "OneWord" words ]
 unit-test
 
 { { "a" "b" "c" "d" "e" "f" } }
 [ "aXbYcXdYeXf" "XY" split ] unit-test
 
 { { "" "" } }
-[ " " " " split ] unit-test
+[ " " words ] unit-test
 
 { { "hey" } }
-[ "hey" " " split ] unit-test
+[ "hey" words ] unit-test
 
 { "Hello world" t } [ "Hello world\n" "\n" ?tail ] unit-test
 { "Hello world" f } [ "Hello world" "\n" ?tail ] unit-test
index 50b2a92df4c5ec76d4071ff8c8a153ee05e99842..ac81862115a118ba7f7a0ee029942bd73602a05f 100644 (file)
@@ -123,3 +123,6 @@ M: sbuf lines "" like lines ;
 
 : unlines-as ( seq exemplar -- seq ) "\n" swap join-as ; inline
 : unlines ( seq -- seq ) "" unlines-as ; inline
+: words ( seq -- seq ) " " split ; inline
+: unwords-as ( seq exemplar -- seq ) " " swap join-as ; inline
+: unwords ( seq -- seq ) " " unwords-as ; inline
index 1a2c8d54024d29c3f458478cc98c052a69421b8a..a8243751aabeb2d2686d577f87a0c5105879d73d 100644 (file)
@@ -15,7 +15,7 @@ IN: 99-bottles
             [ bottles "of beer.\nTake one down, pass it around," ]
             [ 1 - bottles [ >lower ] dip "of beer on the wall." ]
         } cleave
-    ] output>array " " join print nl ;
+    ] output>array unwords print nl ;
 
 : last-verse ( -- )
     "No more bottles of beer on the wall, no more bottles of beer." print
index 2b6d79feeb29ec0566d48128c0a9ed783e7815aa..dd7a6f5374560bfdf84cbeb83f70a409d7502d2b 100644 (file)
@@ -80,7 +80,7 @@ TUPLE: meeting-place count mailbox ;
     ] if ;
 
 : number>chameneos-string ( n -- string )
-    number>string string>digits [ number>text ] { } map-as " " join ;
+    number>string string>digits [ number>text ] { } map-as unwords ;
 
 : chameneos-redux ( n colors -- )
     [ <meeting-place> ] [ make-creatures ] bi*
index 80c552add1ffd618f223e625eb38c41ac784309f..b3568cf79c6ca3bd8b25b961e23a482cfd31222c 100644 (file)
@@ -4,7 +4,7 @@ USING: kernel math random sequences strings unicode ;
 IN: benchmark.unicode
 
 : crazy-unicode-string ( -- string )
-    8 [ 8 0xffff random-integers ] replicate " " join ;
+    8 [ 8 0xffff random-integers ] replicate unwords ;
 
 : unicode-benchmark ( -- )
     crazy-unicode-string 8 [
index f40608eac36ce64e4bd824471094552979fcd958..6adf6a831001adb294742060d0c4d16c6baf88a9 100644 (file)
@@ -67,7 +67,7 @@ math.parser math.ranges sequences tools.test ;
 
 ! Squares of numbers from 0 to 100
 
-${ 100 [0,b] [ dup * number>string ] map "\n" join "\n" append }
+${ 100 [0,b] [ dup * number>string ] map unlines "\n" append }
 [
     "
     ++++[>+++++<-]>[<+++++>-]+<+[
index cf0fafe96a0b43932d04a67a8072bb088df00eff..47ef5332ad5bc0aca755dab27925130ac8fa3f9e 100644 (file)
@@ -9,7 +9,7 @@ SPECIALIZED-ARRAY: c:uint
 IN: bunny.model
 
 : numbers ( str -- seq )
-    " " split [ string>number ] map sift ;
+    words [ string>number ] map sift ;
 
 : (parse-model) ( vs is -- vs is )
     readln [
index 3df67e01efdbee48bc137e8a9b473e86386d2ce9..50fed8261c774142d8bfb359a3a2e852ed01de41 100644 (file)
@@ -66,5 +66,5 @@ splitting tools.test ;
 { f } [ H{ { 1 H{ { 3 4 } } } } { [ 1 of ] [ 2 of ] } chain ] unit-test
 { f } [ H{ { 2 H{ { 3 4 } } } } { [ 1 of ] [ 2 of ] } chain ] unit-test
 { 5 } [
-    "hello factor!" { [ " " split ] [ first ] [ length ] } chain
+    "hello factor!" { [ words ] [ first ] [ length ] } chain
 ] unit-test
index 3d0f68fc7a083e1af1df62117617670204205fa1..5ce852bd31cad754fad70060d9c4f0cdee0f7717 100644 (file)
@@ -14,7 +14,7 @@ M: integer-expr expr>str value>> number>string ;
 
 M: reference-expr expr>str value>> unparse ;
 
-M: sequence expr>str [ unparse ] map " " join ;
+M: sequence expr>str [ unparse ] map unwords ;
 
 M: object expr>str unparse ;
 
index adb06e68f09c8e366488f194c8eacd9f75e88ded..8df417e207b69e81df142d38d62416de9d106b2e 100644 (file)
@@ -1375,7 +1375,7 @@ SYMBOL: last-opcode
     ! Process the list of strings, which should make
     ! up an 8080 instruction, and output a quotation
     ! that would implement that instruction.
-    dup " " join instruction-quotations
+    dup unwords instruction-quotations
     [
        "_" join [ "emulate-" % % ] "" make create-word-in
        dup last-instruction set-global
index 389aba9539ed243102086c9b56ab5c4e2e348078..7a4f7f39ef2a5064ea2f54117c3b837296b1eaf0 100644 (file)
@@ -51,7 +51,7 @@ IN: cuda.devices
         [ "Memory: " write cuda-device-memory number>string print ]
         [
             "Capability: " write
-            cuda-device-capability [ number>string ] map " " join print
+            cuda-device-capability [ number>string ] map unwords print
         ]
         [ "Properties: " write cuda-device-properties . ]
         [
index 9b720094d045e4f4c5942ce38c36a9e3d9ebcc6e..43112da8c8f681ef1db62969bb965e5e535a7fb8 100644 (file)
@@ -53,7 +53,7 @@ PRIVATE>
     dup connect-opposite-edges ;
 
 : parse-vertex ( line -- position )
-    " " split first3 [ string>number >float ] tri@ 0.0 double-4-boa ;
+    words first3 [ string>number >float ] tri@ 0.0 double-4-boa ;
 
 : read-vertex ( line vertices -- )
     [ parse-vertex ] dip push ;
@@ -63,7 +63,7 @@ PRIVATE>
     dup 0 >= [ nip 1 - ] [ [ length ] dip + ] if ;
 
 : parse-face ( line vertices -- vertices )
-    [ " " split ] dip '[ _ parse-face-index ] map ;
+    [ words ] dip '[ _ parse-face-index ] map ;
 
 : read-face ( line vertices faces -- )
     [ parse-face ] dip push ;
index 373d0f800ff350bccce5170ed5e4e69a6b76fe6f..4da5894179a07ba61f89bdc2788628c5bad202d8 100644 (file)
@@ -33,7 +33,7 @@ TUPLE: ip-entry from to registry assigned city cntry country ;
 
 MEMO: ip-db ( -- seq )
     download-db ascii file-lines
-    [ "#" head? ] reject "\n" join string>csv
+    [ "#" head? ] reject unlines string>csv
     [ parse-ip-entry ] map ;
 
 : filter-overlaps ( alist -- alist' )
index 738c50725f327218a23051e2670ffcfcf55adfbc..570555828208b20aa496019da71380ff113e4ab0 100644 (file)
@@ -135,9 +135,9 @@ CONSTRUCTOR: <tree> tree ( -- obj ) ;
 : commit. ( commit -- )
     {
         [ hash>> "commit " prepend print ]
-        [ author>> "Author: " prepend " " split 2 head* " " join print ]
-        [ author>> " " split git-date>string "Date:   " prepend print ]
-        [ message>> "\n" split [ "    " prepend ] map "\n" join nl print nl ]
+        [ author>> "Author: " prepend words 2 head* unwords print ]
+        [ author>> words git-date>string "Date:   " prepend print ]
+        [ message>> "\n" split [ "    " prepend ] map unlines nl print nl ]
     } cleave ;
 
 ERROR: unknown-field name parameter ;
@@ -162,7 +162,7 @@ ERROR: unknown-field name parameter ;
             ] [
                 [ first " " split1 ]
                 [ rest [ rest ] map ] bi
-                swap prefix "\n" join 2array
+                swap prefix unlines 2array
             ] if
         ] map
     ] [
index 0a07551161ecec3750bf9ca9bbd95c95dfb776cf..61bddd35aac5b4e751a105f1c1600b00dfdd850c 100644 (file)
@@ -332,7 +332,7 @@ SYMBOL: padding-no
 : replace-log-line-numbers ( object log -- log' )
     "\n" split harvest
     [ replace-log-line-number ] with map
-    "\n" join ;
+    unlines ;
 
 : gl-shader-kind ( shader-kind -- shader-kind )
     {
index 048fce04644cd1507591cfa921b870c899f2b8a4..12cee2e4085eb7f1885ee0d280ce13c336d8b0c0 100644 (file)
@@ -1,10 +1,9 @@
 USING: accessors arrays assocs calendar calendar.english
-calendar.format calendar.parser formatting fry grouping io
-io.crlf io.encodings.ascii io.encodings.binary
-io.encodings.string io.encodings.utf7 io.encodings.utf8
-io.sockets io.sockets.secure io.streams.duplex io.streams.string
-kernel math math.parser multiline pcre sequences
-sequences.extras strings ;
+calendar.format calendar.parser formatting grouping io io.crlf
+io.encodings.ascii io.encodings.binary io.encodings.string
+io.encodings.utf7 io.encodings.utf8 io.sockets io.sockets.secure
+io.streams.duplex io.streams.string kernel math math.parser
+multiline sequences sequences.extras splitting strings ;
 QUALIFIED: pcre
 IN: imap
 
@@ -79,7 +78,7 @@ CONSTANT: IMAP4_SSL_PORT 993
 
 ! Special parsing
 : parse-items ( seq -- items )
-    first " " split 2 tail ;
+    first words 2 tail ;
 
 : parse-list-folders ( str -- folder )
     [[ \* LIST \(([^\)]+)\) "([^"]+)" "?([^"]+)"?]] pcre:findall
@@ -96,11 +95,11 @@ CONSTANT: IMAP4_SSL_PORT 993
 
 : parse-status ( seq -- assoc )
     first [[ \* STATUS "[^"]+" \(([^\)]+)\)]] pcre:findall first last last
-    " " split 2 group [ string>number ] assoc-map ;
+    words 2 group [ string>number ] assoc-map ;
 
 : parse-store-mail-line ( str -- pair/f )
     [[ \(FLAGS \(([^\)]+)\) UID (\d+)\)]] pcre:findall [ f ] [
-        first rest values first2 [ " " split ] dip string>number swap 2array
+        first rest values first2 [ words ] dip string>number swap 2array
     ] if-empty ;
 
 : parse-store-mail ( seq -- assoc )
@@ -145,7 +144,7 @@ PRIVATE>
     drop ;
 
 : status-folder ( mailbox keys -- assoc )
-    [ >utf7imap4 ] dip " " join "STATUS \"%s\" (%s)" sprintf
+    [ >utf7imap4 ] dip unwords "STATUS \"%s\" (%s)" sprintf
     "" command-response parse-status ;
 
 : close-folder ( -- )
index e79431a9fdb1ee60bfd81f297ffc8b8165f1b383..0166c006813abd17531f97f3adf1036faaa645ab 100644 (file)
@@ -80,9 +80,9 @@ M: irc-message set-irc-command
     {
         [ prefix>> ]
         [ command>> ]
-        [ parameters>> " " join ]
+        [ parameters>> unwords ]
         [ trailing>> dup [ CHAR: : prefix ] when ]
-    } cleave 4array sift " " join ;
+    } cleave 4array sift unwords ;
 
 <PRIVATE
 : ?define-irc-parameters ( class slot-names -- )
index ba27dd83969332e59e9eace2b6246e84b69522f6..b8c3cd2ca90514c23634f9b34f0286f07e67b7bb 100644 (file)
@@ -68,7 +68,7 @@ PREDICATE: ctcp < privmsg
 PREDICATE: action < ctcp trailing>> rest "ACTION" head? ;
 
 M: rpl-names post-process-irc-message ( rpl-names -- )
-    [ [ blank? ] trim " " split ] change-nicks drop ;
+    [ [ blank? ] trim words ] change-nicks drop ;
 
 M: ctcp post-process-irc-message ( ctcp -- )
     [ rest but-last ] change-text drop ;
index 829236cb16703bfb22157427b7a83409b9fbd68d..9d28f33503bf0c5f88ae628bb5b428965ec538fe 100644 (file)
@@ -13,7 +13,7 @@ IN: irc.messages.parser
 : split-message ( string -- prefix command parameters trailing )
     ":" ?head [ " " split1 ] [ f swap ] if
     ":" split1
-    [ " " split harvest unclip swap ] dip ;
+    [ words harvest unclip swap ] dip ;
 
 : sender ( irc-message -- sender )
     prefix>> [ ":" ?head drop "!" split-at-first drop ] [ f ] if* ;
index 0ac74a6f92c7a32d156c290bdb3aea323e3d439f..9dffc1603e2138d5955e181e3a41a8e1828e16dd 100644 (file)
@@ -16,7 +16,7 @@ IN: lcd
     '[ _ lcd-digit ] { } map-as concat ;
 
 : lcd ( digit-str -- string )
-    4 <iota> [ lcd-row ] with map "\n" join ;
+    4 <iota> [ lcd-row ] with map unlines ;
 
 TUPLE: time-display < label timer ;
 
index 1a9954f8b45d148d3d505e676667eee697237bde..1d3c88503df56b28ace9eeb91534f121bd9d8862 100644 (file)
@@ -8,7 +8,7 @@ IN: mason.git
 
 : git-id ( -- id )
     { "git" "show" } utf8 [ lines ] with-process-reader
-    first " " split second ;
+    first words second ;
 
 <PRIVATE
 
index d8447c24e121d2f4dfedf9a41e1f9f901dbb3a95..f505556b70a84e1bb9dc09b95f658c1cdf99488c 100644 (file)
@@ -37,7 +37,7 @@ IN: mason.report
     ] with-file-writer ; inline
 
 : file-tail ( file encoding lines -- seq )
-    [ file-lines ] dip short tail* "\n" join ;
+    [ file-lines ] dip short tail* unlines ;
 
 :: failed-report ( error file what -- status )
     [
index d93308e8a1c70e670bcea6b31ef5bab644e14938..daf90033b567cbcc4d8ba587688d969540bca618 100644 (file)
@@ -70,7 +70,7 @@ MEMO: units ( -- seq ) ! up to 10^99
 
 : over-1000000 ( n -- str )
     3 digit-groups [ 1 + units nth n-units ] map-index sift
-    reverse " " join ;
+    reverse unwords ;
 
 : decompose ( n -- str ) 1000000 /mod [ over-1000000 ] dip
     dup 0 > [ basic space-append ] [ drop ] if ;
index 1fc78adc4302c6edb75d488775187155faa066f4..cba09c6bd3d6693a159f6757248baccab6e8b9d9 100644 (file)
@@ -275,7 +275,7 @@ CONSTANT: compass-directions H{
             [ drop f ]
         } case [
             2 group dup [ weather key? ] all?
-            [ [ weather at ] map " " join ]
+            [ [ weather at ] map unwords ]
             [ concat parse-glossary ] if
         ] dip prepend
     ] if ;
@@ -488,7 +488,7 @@ CONSTANT: high-clouds H{
     [ [ f ] [ low-clouds at "low clouds are %s" sprintf ] if-zero ]
     [ [ f ] [ mid-clouds at "middle clouds are %s" sprintf ] if-zero ]
     [ [ f ] [ high-clouds at "high clouds are %s" sprintf ] if-zero ]
-    tri* 3array " " join ;
+    tri* 3array unwords ;
 
 : parse-inches ( str -- str' )
     dup [ CHAR: / = ] all? [ drop "unknown" ] [
@@ -524,7 +524,7 @@ CONSTANT: high-clouds H{
     "sea-level pressure is %s hPa" sprintf ;
 
 : parse-lightning ( str -- str' )
-    "LTG" ?head drop 2 group [ lightning at ] map " " join ;
+    "LTG" ?head drop 2 group [ lightning at ] map unwords ;
 
 CONSTANT: re-recent-weather R/ ((\w{2})?[BE]\d{2,4}((\w{2})?[BE]\d{2,4})?)+/
 
@@ -547,7 +547,7 @@ CONSTANT: re-recent-weather R/ ((\w{2})?[BE]\d{2,4}((\w{2})?[BE]\d{2,4})?)+/
 
 : parse-recent-weather ( str -- str' )
     split-recent-weather
-    [ (parse-recent-weather) ] map " " join ;
+    [ (parse-recent-weather) ] map unwords ;
 
 : parse-varying ( str -- str' )
     "V" split1 [ string>number ] bi@
@@ -604,7 +604,7 @@ CONSTANT: re-recent-weather R/ ((\w{2})?[BE]\d{2,4}((\w{2})?[BE]\d{2,4})?)+/
     } cond ;
 
 : metar-remarks ( report seq -- report )
-    [ parse-remark ] map " " join >>remarks ;
+    [ parse-remark ] map unwords >>remarks ;
 
 : <metar-report> ( metar -- report )
     [ metar-report new ] dip [ >>raw ] keep
index 59e7514dc0d339c3bd70cdd937215c21be17d1fc..c9789e2fdac5aeda3a38dcb9740d3d828b8ffa8f 100644 (file)
@@ -187,12 +187,12 @@ GENERIC: write-html ( tag -- )
 
 M: doctype write-html
     [ open>> % ]
-    [ values>> [ >value ] map " " join [ " " % % ] unless-empty ]
+    [ values>> [ >value ] map unwords [ " " % % ] unless-empty ]
     [ close>> % ] tri ;
 
 
 : write-props ( seq -- )
-    [ dup array? [ first2 >value "=" glue ] [ >value ] if ] map " " join [ " " % % ] unless-empty ;
+    [ dup array? [ first2 >value "=" glue ] [ >value ] if ] map unwords [ " " % % ] unless-empty ;
 
 M: open-tag write-html
     {
index 23301ed3f8fbb2ab9d2376700be995496db64298..84e250febd4182a68515afba2d78b754be21c141 100644 (file)
@@ -87,19 +87,19 @@ CONSTANT: morse-code-table $[
 <PRIVATE
 
 : word>morse ( str -- morse )
-    [ ch>morse ] { } map-as " " join ;
+    [ ch>morse ] { } map-as unwords ;
 
 : sentence>morse ( str -- morse )
-    " " split [ word>morse ] map " / " join ;
+    words [ word>morse ] map " / " join ;
 
 : trim-blanks ( str -- newstr )
     [ blank? ] trim ; inline
 
 : morse>word ( morse -- str )
-    " " split [ morse>ch ] "" map-as ;
+    words [ morse>ch ] "" map-as ;
 
 : morse>sentence ( morse -- sentence )
-    "/" split [ trim-blanks morse>word ] map " " join ;
+    "/" split [ trim-blanks morse>word ] map unwords ;
 
 : replace-underscores ( str -- str' )
     [ dup CHAR: _ = [ drop CHAR: - ] when ] map ;
index 75b9c3b6305dc0e76b12f0d200883e9288609750..d3b71c569f380846ecce3a407d1798abb66280b1 100644 (file)
@@ -1,4 +1,4 @@
 USING: pcre.ffi sequences splitting tools.test ;
 IN: pcre.ffi.tests
 
-{ 2 } [ pcre_version " " split length ] unit-test
+{ 2 } [ pcre_version words length ] unit-test
index 5af515b73d62b4337788bd29a6941e54c8cba4d6..990b0272694bbae52fb4fcefbb75d616cadbe0ad 100644 (file)
@@ -318,7 +318,7 @@ M: table pdf-width
         "/Type /Catalog"
         "/Pages 15 0 R"
         ">>"
-    } "\n" join ;
+    } unlines ;
 
 : pdf-pages ( n -- str )
     [
@@ -332,7 +332,7 @@ M: table pdf-width
             "/Kids [ " "]" surround ,
         ] bi
         ">>" ,
-    ] { } make "\n" join ;
+    ] { } make unlines ;
 
 : pdf-page ( n -- page )
     [
@@ -347,7 +347,7 @@ M: table pdf-width
         "/F10 12 0 R /F11 13 0 R /F12 14 0 R" ,
         ">> >>" ,
         ">>" ,
-    ] { } make "\n" join ;
+    ] { } make unlines ;
 
 : pdf-trailer ( objects -- str )
     [
@@ -366,7 +366,7 @@ M: table pdf-width
         "startxref" ,
         [ length 1 + ] map-sum 9 + "%d" sprintf ,
         "%%EOF" ,
-    ] { } make "\n" join ;
+    ] { } make unlines ;
 
 SYMBOLS: pdf-producer pdf-author pdf-creator ;
 
@@ -425,7 +425,7 @@ TUPLE: pdf info pages fonts ;
     dup length [1,b] zip [ first2 pdf-object ] map ;
 
 : objects>pdf ( objects -- str )
-    [ "\n" join "\n" append "%PDF-1.4\n" ]
+    [ unlines "\n" append "%PDF-1.4\n" ]
     [ pdf-trailer ] bi surround ;
 
 ! Rename to pdf>string, have it take a <pdf> object?
index 33f0797baf30ec9ba8c505b9d3448b09a847412d..e2122f02c6c66a67de6506bfd341d7647499efbe 100644 (file)
@@ -59,7 +59,7 @@ M: font pdf-value
         } cleave
         "/BaseFont " prepend ,
         ">>" ,
-    ] { } make "\n" join ;
+    ] { } make unlines ;
 
 M: timestamp pdf-value
     "%Y%m%d%H%M%S" strftime "D:" prepend ;
index bc6edf5fd2f1d789010373fc658ddf4cde2705bc..f445c50c98f522176ffceabd4e7b466fa8462201 100644 (file)
@@ -79,7 +79,7 @@ M: string >ckf >upper 1 cut (>ckf) ;
 M: integer >ckf ;
 
 : parse-cards ( string -- seq )
-    " " split [ >ckf ] map ;
+    words [ >ckf ] map ;
 
 : flush? ( cards -- ? )
     0xF000 [ bitand ] reduce 0 = not ;
index c99eb8678e11914ff6a83d24d885cdbad6014fa8..576393d577f9a6efedad27d9b88a4584dec33729 100644 (file)
@@ -45,14 +45,14 @@ TUPLE: raw-source top headers content ;
 : get-ok-and-total ( -- total )
     stream [
         readln dup "+OK" head? [
-            " " split second string>number dup account count<<
+            words second string>number dup account count<<
         ] [ throw ] if
     ] with-stream* ;
 
 : get-ok-and-uidl ( -- uidl )
     stream [
         readln dup "+OK" head? [
-            " " split last
+            words last
         ] [ throw ] if
     ] with-stream* ;
 
index 7f3472f306a6ff5c7c299918170fafdf7c042fd3..c0c0fd111703b1d5a2cb8472d62372ab41456228 100644 (file)
@@ -39,7 +39,7 @@ IN: project-euler.067
 
 : source-067 ( -- seq )
     "resource:extra/project-euler/067/triangle.txt"
-    ascii file-lines [ " " split [ string>number ] map ] map ;
+    ascii file-lines [ words [ string>number ] map ] map ;
 
 PRIVATE>
 
index 69f07e02c07b95984b7e78db09e951a580f77660..9e4e212d5a34a75e4b786402d8ea3b5a27090227 100644 (file)
@@ -107,7 +107,7 @@ PY-METHODS: code =>
         ArgumentParser dup
         "--foo" >py H{ { "help" "badger" } } >py add_argument
         format_help py>
-    ] with-destructors [ blank? ] s:trim " " split "badger" swap in?
+    ] with-destructors [ blank? ] s:trim words "badger" swap in?
 ] py-test
 
 { t } [
index 13c3d242ef39bc5d03a5d08993e6dfa57dc793c5..48a62c15ee6842a585beb47341b35c2d393259b0 100644 (file)
@@ -51,7 +51,7 @@ M: multiple-choice-question generate-question*
     [ n>> ] [ generator>> ] bi
     '[ _ generate-question* ] replicate ;
 
-: trim-blanks ( seq -- seq' ) " " split harvest " " join ;
+: trim-blanks ( seq -- seq' ) words harvest unwords ;
 : first-n-letters ( n -- seq ) <iota> [ CHAR: a + 1string ] map ;
 : alphabet-zip ( seq -- zip ) [ length <iota> [ CHAR: a + 1string ] { } map-as ] keep zip ;
 M: question parse-response drop trim-blanks ;
@@ -96,7 +96,7 @@ CONSTANT: stack-shufflers { dup 2dup drop 2drop swap over rot -rot roll -roll 2d
 M: stack-shuffler generate-question*
     n-shufflers>> [ stack-shufflers random ] [ ] replicate-as
     [ inputs first-n-letters ] keep
-    '[ _ _ with-datastack " " join ] ;
+    '[ _ _ with-datastack unwords ] ;
 
 M: question ask-question generated>> . ;
 M: string-response ask-question generated>> . ;
index 1a2009a552adb541be774cd03ab678c9c36af1ca..5db404c8d8f4d44c5837119861a34aafb62b181d 100644 (file)
@@ -38,6 +38,6 @@ CONSTANT: words {
 : select ( seq -- seq' ) [ amb-lazy ] map ;
 
 : search ( -- )
-    words select dup sentence-match? [ " " join ] [ fail ] if . ;
+    words select dup sentence-match? [ unwords ] [ fail ] if . ;
 
 MAIN: search
index 0f1bbc993c5ebe20d64aad89bc2fbb21710c7084..381a820ce5486c03b04f509366824dd9f9b91275 100644 (file)
@@ -31,7 +31,7 @@ IN: rosetta-code.sierpinski-triangle
     [ drop [ dup " " glue ] map ] 2bi append ;
 
 : (sierpinski) ( triangle spaces n -- triangle' )
-    dup 0 = [ 2drop "\n" join ] [
+    dup 0 = [ 2drop unlines ] [
         [
             [ iterate-triangle ]
             [ nip dup append ] 2bi
index 994347091642a0d10a60b170c146be67e6e4795f..25a0d94f1edece4c39ae2359038a59d1f49183aa 100644 (file)
@@ -34,7 +34,7 @@ TUPLE: maxlicense max-count current-count times ;
 
 : out? ( line -- ? ) [ "OUT" ] dip subseq? ; inline
 
-: line-time ( line -- time ) " " split harvest fourth ; inline
+: line-time ( line -- time ) words harvest fourth ; inline
 
 : update-max-count ( max -- max' )
     dup [ current-count>> ] [ max-count>> ] bi >
index fd39ed09a8e64a2cda5f1c68fd342c63c93e7965..f01f28ad9c58c8d18b2b31b56bf46834f912a6eb 100644 (file)
@@ -19,7 +19,7 @@ M: div-insn eval-insn drop [ / ] binary-op ;
 M: push-insn eval-insn value>> swons ;
 
 : rpn-tokenize ( string -- string' )
-    " " split harvest sequence>list ;
+    words harvest sequence>list ;
 
 : rpn-parse ( string -- tokens )
     rpn-tokenize [
index cbf4baf74dfb4eb87cada49327ec999b51b95f04..eac54a0f387e23e362829b2290a17cf877fdb7e7 100644 (file)
@@ -20,13 +20,13 @@ GENERIC: array-element>string ( object -- string )
 M: object array-element>string smalltalk>string ;
 
 M: array array-element>string
-    [ array-element>string ] map " " join "(" ")" surround ;
+    [ array-element>string ] map unwords "(" ")" surround ;
 
 M: array smalltalk>string
     array-element>string "#" prepend ;
 
 M: byte-array smalltalk>string
-    [ number>string ] { } map-as " " join "#[" "]" surround ;
+    [ number>string ] { } map-as unwords "#[" "]" surround ;
 
 M: symbol smalltalk>string
     name>> smalltalk>string "#" prepend ;
index 0a8541b00d64930f2b9d510d0b947406e35e2088..98af8bbe3205c454bd939ddca1377a5ebbdc57bd 100644 (file)
@@ -26,7 +26,7 @@ TUPLE: srt-chunk id begin-time end-time rect text ;
         ?second "  " split1
         [ "-->" split1 [ [ blank? ] trim parse-srt-timestamp ] bi@ ]
         [
-            [ blank? ] trim " " split sift [
+            [ blank? ] trim words sift [
                 f
             ] [
                 [ ":" split1 nip string>number ] map
@@ -34,7 +34,7 @@ TUPLE: srt-chunk id begin-time end-time rect text ;
             ] if-empty
         ] bi*
     ]
-    [ 2 tail "\n" join ] tri srt-chunk boa ;
+    [ 2 tail unlines ] tri srt-chunk boa ;
 
 : parse-srt-lines ( seq -- seq' )
     { "" } split harvest
index 897d858a50d5e087edbc1435dcbc121bb4f26ff0..c6159dfee8b2cbd93da852387a889e250c5fc308 100644 (file)
@@ -36,7 +36,7 @@ IN: text-to-pdf
         "/Author " "USER" os-env "unknown" or pdf-string append ,
         "/Creator (created with Factor)" ,
         ">>" ,
-    ] { } make "\n" join ;
+    ] { } make unlines ;
 
 : pdf-catalog ( -- str )
     {
@@ -44,7 +44,7 @@ IN: text-to-pdf
         "/Type /Catalog"
         "/Pages 4 0 R"
         ">>"
-    } "\n" join ;
+    } unlines ;
 
 : pdf-font ( -- str )
     {
@@ -53,7 +53,7 @@ IN: text-to-pdf
         "/Subtype /Type1"
         "/BaseFont /Courier"
         ">>"
-    } "\n" join ;
+    } unlines ;
 
 : pdf-pages ( n -- str )
     [
@@ -67,7 +67,7 @@ IN: text-to-pdf
             "/Kids [ " "]" surround ,
         ] bi
         ">>" ,
-    ] { } make "\n" join ;
+    ] { } make unlines ;
 
 : pdf-text ( lines -- str )
     [
@@ -77,7 +77,7 @@ IN: text-to-pdf
         "12 TL" ,
         [ pdf-string "'" append , ] each
         "ET" ,
-    ] { } make "\n" join pdf-stream ;
+    ] { } make unlines pdf-stream ;
 
 : pdf-page ( n -- page )
     [
@@ -87,7 +87,7 @@ IN: text-to-pdf
         1 + "/Contents %d 0 R" sprintf ,
         "/Resources << /Font << /F1 3 0 R >> >>" ,
         ">>" ,
-    ] { } make "\n" join ;
+    ] { } make unlines ;
 
 : pdf-trailer ( objects -- str )
     [
@@ -106,7 +106,7 @@ IN: text-to-pdf
         "startxref" ,
         [ length 1 + ] map-sum 9 + "%d" sprintf ,
         "%%EOF" ,
-    ] { } make "\n" join ;
+    ] { } make unlines ;
 
 : string>lines ( str -- lines )
     "\t" split "    " join lines
@@ -127,7 +127,7 @@ IN: text-to-pdf
     dup length [1,b] zip [ first2 pdf-object ] map ;
 
 : objects>pdf ( objects -- str )
-    [ "\n" join "\n" append "%PDF-1.4\n" ]
+    [ unlines "\n" append "%PDF-1.4\n" ]
     [ pdf-trailer ] bi surround ;
 
 PRIVATE>
index 6b6377fbc0ec0e319f475785910e317f65aaf410..f2c4e498efd9c00dfd34ce6a84e1232b36432b71 100644 (file)
@@ -32,7 +32,7 @@ M: integer speak number>text speak-text ;
     command-line get [
         [ speak ] each-line
     ] [
-        " " join speak
+        unwords speak
     ] if-empty ;
 
 MAIN: speak-main
index 0fcf9db16bba11d85b2416c96f0d28716d12affd..13401d87fdc616293397f7aa04437d42162c9f35 100644 (file)
@@ -9,7 +9,7 @@ IN: tools.echo
     [ first "-n" = ] keep over [ rest ] when ;
 
 : echo-args ( args -- )
-    -n? " " join write [ nl ] unless ;
+    -n? unwords write [ nl ] unless ;
 
 : run-echo ( -- )
     command-line get [ nl ] [ echo-args ] if-empty ;
index 59b02a611f77d826aba82b82943693172d9154e0..554ff4b65e7563076dc8b1a92ef8facfac2d97c7 100644 (file)
@@ -66,12 +66,12 @@ PRIVATE>
 GENERIC: >txon ( object -- string )
 
 M: sequence >txon
-    [ >txon ] map "\n" join ;
+    [ >txon ] map unlines ;
 
 M: assoc >txon
     >alist [
         first2 [ encode-value ] [ >txon ] bi* "%s:`%s`" sprintf
-    ] map "\n" join ;
+    ] map unlines ;
 
 M: string >txon
     encode-value ;
index 239011c8f1967c766173c8213f0e8d3a56568371..c2e0446d144a6d097dd120c914ef8def33d7a46d 100644 (file)
@@ -13,7 +13,7 @@ IN: webapps.mason.version.binary
     ] "" make ;
 
 : binary-release-script ( version builders -- string )
-    [ binary-release-command ] with map "\n" join ;
+    [ binary-release-command ] with map unlines ;
 
 : do-binary-release ( version builders -- )
     "Copying binary releases to release directory..." print flush
index 4f39db82d3a2ddb756e86719c6c4f986411c762d..f165f7fd5359518579c299d7d905d9ac7473617d 100644 (file)
@@ -15,7 +15,7 @@ IN: zeromq.examples.wuclient
         2dup >byte-array ZMQ_SUBSCRIBE swap zmq-setopt
         0 100 dup [
             [ pick 0 zmq-recv
-              >string " " split [ string>number ] map second +
+              >string words [ string>number ] map second +
             ] times
         ] dip
         / "Average temperature for zipcode '%s' was %dF\n" printf