From b8d0c7c88e980156b08bb8b5e68c69d261c08626 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 20 Dec 2021 14:54:15 -0600 Subject: [PATCH] core: Add words/unwords/unwords-as and use them. Related to #2140 --- basis/bootstrap/stage2.factor | 2 +- basis/calendar/format/format.factor | 4 ++-- basis/compiler/cfg/debugger/debugger.factor | 17 +++++++++-------- .../instructions/syntax/syntax-docs.factor | 2 +- basis/db/postgresql/lib/lib.factor | 2 +- basis/db/sqlite/sqlite-tests.factor | 2 +- basis/documents/documents.factor | 2 +- basis/farkup/farkup.factor | 2 +- basis/formatting/formatting.factor | 2 +- .../listing-parser/listing-parser.factor | 2 +- basis/furnace/actions/actions.factor | 2 +- basis/furnace/chloe-tags/chloe-tags.factor | 2 +- .../gobject-introspection.factor | 2 +- basis/help/html/html.factor | 2 +- basis/help/markup/markup.factor | 12 ++++++------ basis/help/search/search.factor | 10 +++++----- basis/help/vocabs/vocabs.factor | 11 +++++------ basis/http/client/client-tests.factor | 2 +- basis/http/http.factor | 2 +- .../server/requests/requests-tests.factor | 2 +- basis/http/server/server-tests.factor | 2 +- basis/io/encodings/gb18030/gb18030.factor | 2 +- basis/io/encodings/iana/iana.factor | 2 +- basis/io/launcher/windows/windows.factor | 2 +- basis/logging/analysis/analysis.factor | 9 ++++----- basis/logging/parser/parser.factor | 6 +++--- basis/math/primes/factors/factors.factor | 4 ++-- basis/opengl/capabilities/capabilities.factor | 2 +- basis/present/present.factor | 4 ++-- basis/strings/tables/tables.factor | 2 +- basis/tools/deploy/backend/backend.factor | 2 +- basis/tools/files/files.factor | 2 +- basis/tools/ps/macosx/macosx.factor | 2 +- basis/tools/scaffold/scaffold.factor | 2 +- basis/ui/gadgets/editors/editors.factor | 2 +- basis/ui/gadgets/labels/labels.factor | 2 +- basis/ui/gadgets/panes/panes.factor | 2 +- basis/ui/gadgets/tables/tables.factor | 2 +- basis/ui/tools/listener/listener.factor | 8 ++++---- .../unicode/collation/collation-tests.factor | 6 +++--- basis/unicode/collation/collation.factor | 2 +- basis/unicode/data/data.factor | 4 ++-- .../unicode/normalize/normalize-tests.factor | 2 +- basis/unix/linux/proc/proc.factor | 16 ++++++++-------- basis/windows/opengl32/opengl32.factor | 2 +- basis/wrap/strings/strings.factor | 4 ++-- core/classes/intersection/intersection.factor | 4 ++-- core/classes/mixin/mixin-tests.factor | 4 ++-- core/classes/tuple/parser/parser-tests.factor | 10 +++++----- core/classes/union/union.factor | 4 ++-- core/parser/parser-tests.factor | 4 ++-- core/sequences/sequences-tests.factor | 2 +- core/splitting/splitting-tests.factor | 8 ++++---- core/splitting/splitting.factor | 3 +++ extra/99-bottles/99-bottles.factor | 2 +- .../chameneos-redux/chameneos-redux.factor | 2 +- extra/benchmark/unicode/unicode.factor | 2 +- extra/brainfuck/brainfuck-tests.factor | 2 +- extra/bunny/model/model.factor | 2 +- extra/combinators/extras/extras-tests.factor | 2 +- extra/compiler/cfg/gvn/testing/testing.factor | 2 +- extra/cpu/8080/emulator/emulator.factor | 2 +- extra/cuda/devices/devices.factor | 2 +- extra/euler/b-rep/io/obj/obj.factor | 4 ++-- extra/geo-ip/geo-ip.factor | 2 +- extra/git/git.factor | 8 ++++---- extra/gpu/shaders/shaders.factor | 2 +- extra/imap/imap.factor | 19 +++++++++---------- extra/irc/messages/base/base.factor | 4 ++-- extra/irc/messages/messages.factor | 2 +- extra/irc/messages/parser/parser.factor | 2 +- extra/lcd/lcd.factor | 2 +- extra/mason/git/git.factor | 2 +- extra/mason/report/report.factor | 2 +- extra/math/text/french/french.factor | 2 +- extra/metar/metar.factor | 10 +++++----- extra/modern/html/html.factor | 4 ++-- extra/morse/morse.factor | 8 ++++---- extra/pcre/ffi/ffi-tests.factor | 2 +- extra/pdf/layout/layout.factor | 10 +++++----- extra/pdf/values/values.factor | 2 +- extra/poker/poker.factor | 2 +- extra/pop3/pop3.factor | 4 ++-- extra/project-euler/067/067.factor | 2 +- extra/python/syntax/syntax-tests.factor | 2 +- extra/quiz/quiz.factor | 4 ++-- extra/rosetta-code/amb/amb.factor | 2 +- .../sierpinski-triangle.factor | 2 +- .../max-licenses/max-licenses.factor | 2 +- extra/rpn/rpn.factor | 2 +- extra/smalltalk/printer/printer.factor | 4 ++-- .../subrip-subtitles/subrip-subtitles.factor | 4 ++-- extra/text-to-pdf/text-to-pdf.factor | 16 ++++++++-------- extra/text-to-speech/text-to-speech.factor | 2 +- extra/tools/echo/echo.factor | 2 +- extra/txon/txon.factor | 4 ++-- .../mason/version/binary/binary.factor | 2 +- extra/zeromq/examples/wuclient.factor | 2 +- 98 files changed, 191 insertions(+), 190 deletions(-) diff --git a/basis/bootstrap/stage2.factor b/basis/bootstrap/stage2.factor index 3ec2024827..5ab2776d78 100644 --- a/basis/bootstrap/stage2.factor +++ b/basis/bootstrap/stage2.factor @@ -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 -- ) diff --git a/basis/calendar/format/format.factor b/basis/calendar/format/format.factor index 016f49963f..f5a57d7f2a 100644 --- a/basis/calendar/format/format.factor +++ b/basis/calendar/format/format.factor @@ -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 ; diff --git a/basis/compiler/cfg/debugger/debugger.factor b/basis/compiler/cfg/debugger/debugger.factor index 884be50db7..debb248996 100644 --- a/basis/compiler/cfg/debugger/debugger.factor +++ b/basis/compiler/cfg/debugger/debugger.factor @@ -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 diff --git a/basis/compiler/cfg/instructions/syntax/syntax-docs.factor b/basis/compiler/cfg/instructions/syntax/syntax-docs.factor index 856b927bb0..990e1e05ba 100644 --- a/basis/compiler/cfg/instructions/syntax/syntax-docs.factor +++ b/basis/compiler/cfg/instructions/syntax/syntax-docs.factor @@ -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 diff --git a/basis/db/postgresql/lib/lib.factor b/basis/db/postgresql/lib/lib.factor index b56ad0bc11..10db939b2a 100644 --- a/basis/db/postgresql/lib/lib.factor +++ b/basis/db/postgresql/lib/lib.factor @@ -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) ; diff --git a/basis/db/sqlite/sqlite-tests.factor b/basis/db/sqlite/sqlite-tests.factor index d9ad216db6..c339e641aa 100644 --- a/basis/db/sqlite/sqlite-tests.factor +++ b/basis/db/sqlite/sqlite-tests.factor @@ -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 ${ diff --git a/basis/documents/documents.factor b/basis/documents/documents.factor index b435a23375..a8d553e860 100644 --- a/basis/documents/documents.factor +++ b/basis/documents/documents.factor @@ -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 ] [ diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index 3d4587b762..879fab36ed 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -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 diff --git a/basis/formatting/formatting.factor b/basis/formatting/formatting.factor index 6141a8552f..494acbb448 100644 --- a/basis/formatting/formatting.factor +++ b/basis/formatting/formatting.factor @@ -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 diff --git a/basis/ftp/client/listing-parser/listing-parser.factor b/basis/ftp/client/listing-parser/listing-parser.factor index 6e2f9ebec4..04402cedcb 100644 --- a/basis/ftp/client/listing-parser/listing-parser.factor +++ b/basis/ftp/client/listing-parser/listing-parser.factor @@ -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 ] } diff --git a/basis/furnace/actions/actions.factor b/basis/furnace/actions/actions.factor index 5e0a7664e0..c49cc5bf36 100644 --- a/basis/furnace/actions/actions.factor +++ b/basis/furnace/actions/actions.factor @@ -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 ] [ <400> ] if* diff --git a/basis/furnace/chloe-tags/chloe-tags.factor b/basis/furnace/chloe-tags/chloe-tags.factor index ac8c4ce519..5052a06a15 100644 --- a/basis/furnace/chloe-tags/chloe-tags.factor +++ b/basis/furnace/chloe-tags/chloe-tags.factor @@ -66,7 +66,7 @@ CHLOE: base compile-a-url [ [XML /> 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 ) diff --git a/basis/gobject-introspection/gobject-introspection.factor b/basis/gobject-introspection/gobject-introspection.factor index 760726084c..23fb5541c7 100644 --- a/basis/gobject-introspection/gobject-introspection.factor +++ b/basis/gobject-introspection/gobject-introspection.factor @@ -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 ; diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index 433c467eba..c18e91025a 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -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 diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index 76616e74f9..33ec69a033 100644 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -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 [ write ] ($code) ; + unlines dup [ 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 [ + unclip-last [ unlines ] dip over [ [ print ] [ output-style get format ] bi* ] ($code) ; diff --git a/basis/help/search/search.factor b/basis/help/search/search.factor index 87db04467f..0dab4860ac 100644 --- a/basis/help/search/search.factor +++ b/basis/help/search/search.factor @@ -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 ; diff --git a/basis/help/vocabs/vocabs.factor b/basis/help/vocabs/vocabs.factor index 8e9fae0773..3820673d6f 100644 --- a/basis/help/vocabs/vocabs.factor +++ b/basis/help/vocabs/vocabs.factor @@ -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 [ [ <$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 diff --git a/basis/http/client/client-tests.factor b/basis/http/client/client-tests.factor index 5d8e11aaaa..e8bcb674d1 100644 --- a/basis/http/client/client-tests.factor +++ b/basis/http/client/client-tests.factor @@ -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 diff --git a/basis/http/http.factor b/basis/http/http.factor index 43420af92e..574f180b97 100644 --- a/basis/http/http.factor +++ b/basis/http/http.factor @@ -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 ; diff --git a/basis/http/server/requests/requests-tests.factor b/basis/http/server/requests/requests-tests.factor index d011cceab6..abde714294 100644 --- a/basis/http/server/requests/requests-tests.factor +++ b/basis/http/server/requests/requests-tests.factor @@ -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 diff --git a/basis/http/server/server-tests.factor b/basis/http/server/server-tests.factor index 167eb7f127..16227e333d 100644 --- a/basis/http/server/server-tests.factor +++ b/basis/http/server/server-tests.factor @@ -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 diff --git a/basis/io/encodings/gb18030/gb18030.factor b/basis/io/encodings/gb18030/gb18030.factor index 6198b406e9..ccfa91e220 100644 --- a/basis/io/encodings/gb18030/gb18030.factor +++ b/basis/io/encodings/gb18030/gb18030.factor @@ -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 -- ) [ diff --git a/basis/io/encodings/iana/iana.factor b/basis/io/encodings/iana/iana.factor index 94a6a077ef..eeb680ea33 100644 --- a/basis/io/encodings/iana/iana.factor +++ b/basis/io/encodings/iana/iana.factor @@ -20,7 +20,7 @@ PRIVATE> > { diff --git a/basis/logging/analysis/analysis.factor b/basis/logging/analysis/analysis.factor index da1df05b33..31cdea1ec1 100644 --- a/basis/logging/analysis/analysis.factor +++ b/basis/logging/analysis/analysis.factor @@ -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 diff --git a/basis/logging/parser/parser.factor b/basis/logging/parser/parser.factor index b5417255b1..ecff2ef1d2 100644 --- a/basis/logging/parser/parser.factor +++ b/basis/logging/parser/parser.factor @@ -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 -- ) diff --git a/basis/math/primes/factors/factors.factor b/basis/math/primes/factors/factors.factor index e39e838524..911a297ca9 100644 --- a/basis/math/primes/factors/factors.factor +++ b/basis/math/primes/factors/factors.factor @@ -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 : 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 ; diff --git a/basis/opengl/capabilities/capabilities.factor b/basis/opengl/capabilities/capabilities.factor index c7a7afc1de..4797000635 100644 --- a/basis/opengl/capabilities/capabilities.factor +++ b/basis/opengl/capabilities/capabilities.factor @@ -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 -- ) diff --git a/basis/present/present.factor b/basis/present/present.factor index 22f4406a0e..6ed7f2831e 100644 --- a/basis/present/present.factor +++ b/basis/present/present.factor @@ -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 ; diff --git a/basis/strings/tables/tables.factor b/basis/strings/tables/tables.factor index c3e5aca1cb..aedaf43b85 100644 --- a/basis/strings/tables/tables.factor +++ b/basis/strings/tables/tables.factor @@ -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 ; diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor index 5e09bbcdca..597449625b 100644 --- a/basis/tools/deploy/backend/backend.factor +++ b/basis/tools/deploy/backend/backend.factor @@ -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 , diff --git a/basis/tools/files/files.factor b/basis/tools/files/files.factor index 262d598b52..0b5b71e476 100644 --- a/basis/tools/files/files.factor +++ b/basis/tools/files/files.factor @@ -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 diff --git a/basis/tools/ps/macosx/macosx.factor b/basis/tools/ps/macosx/macosx.factor index a7e9d42387..eecb31cbdd 100644 --- a/basis/tools/ps/macosx/macosx.factor +++ b/basis/tools/ps/macosx/macosx.factor @@ -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 ; diff --git a/basis/tools/scaffold/scaffold.factor b/basis/tools/scaffold/scaffold.factor index 0629be1b50..48be516a25 100644 --- a/basis/tools/scaffold/scaffold.factor +++ b/basis/tools/scaffold/scaffold.factor @@ -341,7 +341,7 @@ PRIVATE> SYMBOL: nested-examples : example-using ( using -- ) - " " join "example-using" [ + unwords "example-using" [ nested-examples get 4 0 ? CHAR: \s "example-indent" [ "${example-indent}\"Example:\" ${example-indent}{ $example \"USING: ${example-using} ;\" diff --git a/basis/ui/gadgets/editors/editors.factor b/basis/ui/gadgets/editors/editors.factor index 3f19c39e39..1973cb2333 100644 --- a/basis/ui/gadgets/editors/editors.factor +++ b/basis/ui/gadgets/editors/editors.factor @@ -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 -- ? ) diff --git a/basis/ui/gadgets/labels/labels.factor b/basis/ui/gadgets/labels/labels.factor index 7ba544392f..270ddc4f21 100644 --- a/basis/ui/gadgets/labels/labels.factor +++ b/basis/ui/gadgets/labels/labels.factor @@ -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 ] "" 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 diff --git a/basis/unicode/collation/collation.factor b/basis/unicode/collation/collation.factor index d1da246d2f..68a155fd5b 100644 --- a/basis/unicode/collation/collation.factor +++ b/basis/unicode/collation/collation.factor @@ -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 ; diff --git a/basis/unicode/data/data.factor b/basis/unicode/data/data.factor index c1497d081d..c5d3c4703c 100644 --- a/basis/unicode/data/data.factor +++ b/basis/unicode/data/data.factor @@ -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> diff --git a/basis/unicode/normalize/normalize-tests.factor b/basis/unicode/normalize/normalize-tests.factor index 71f0a4f7ef..a97fc42231 100644 --- a/basis/unicode/normalize/normalize-tests.factor +++ b/basis/unicode/normalize/normalize-tests.factor @@ -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 ; diff --git a/basis/unix/linux/proc/proc.factor b/basis/unix/linux/proc/proc.factor index c2de4270f8..205e312e72 100644 --- a/basis/unix/linux/proc/proc.factor +++ b/basis/unix/linux/proc/proc.factor @@ -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 ] inputcpu ] 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 ] inputboolean ; : 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? ; diff --git a/basis/wrap/strings/strings.factor b/basis/wrap/strings/strings.factor index 46e8b792b7..ddfd053900 100644 --- a/basis/wrap/strings/strings.factor +++ b/basis/wrap/strings/strings.factor @@ -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> diff --git a/core/classes/intersection/intersection.factor b/core/classes/intersection/intersection.factor index bd18ca61b6..691006c211 100644 --- a/core/classes/intersection/intersection.factor +++ b/core/classes/intersection/intersection.factor @@ -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> diff --git a/core/classes/mixin/mixin-tests.factor b/core/classes/mixin/mixin-tests.factor index c8e48888d8..5c40dccd84 100644 --- a/core/classes/mixin/mixin-tests.factor +++ b/core/classes/mixin/mixin-tests.factor @@ -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 "mixin-forget-test" + } unlines "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 "mixin-forget-test" + } unlines "mixin-forget-test" parse-stream drop ] unit-test diff --git a/core/classes/tuple/parser/parser-tests.factor b/core/classes/tuple/parser/parser-tests.factor index 2f410c221b..836dc4c8b0 100644 --- a/core/classes/tuple/parser/parser-tests.factor +++ b/core/classes/tuple/parser/parser-tests.factor @@ -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 ; diff --git a/core/classes/union/union.factor b/core/classes/union/union.factor index 9f9afe20a8..b292640417 100644 --- a/core/classes/union/union.factor +++ b/core/classes/union/union.factor @@ -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 normalize-class ; diff --git a/core/parser/parser-tests.factor b/core/parser/parser-tests.factor index 58ea85917b..7d17a58dfa 100644 --- a/core/parser/parser-tests.factor +++ b/core/parser/parser-tests.factor @@ -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 "change-combination-test" parse-stream drop + } unlines "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 "change-combination-test" parse-stream drop + } unlines "change-combination-test" parse-stream drop ] unit-test { 2 } [ diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index 61ca2d6e80..9acdf6e0b1 100644 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -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 diff --git a/core/splitting/splitting-tests.factor b/core/splitting/splitting-tests.factor index 7285ce20df..2c67654571 100644 --- a/core/splitting/splitting-tests.factor +++ b/core/splitting/splitting-tests.factor @@ -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 diff --git a/core/splitting/splitting.factor b/core/splitting/splitting.factor index 50b2a92df4..ac81862115 100644 --- a/core/splitting/splitting.factor +++ b/core/splitting/splitting.factor @@ -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 diff --git a/extra/99-bottles/99-bottles.factor b/extra/99-bottles/99-bottles.factor index 1a2c8d5402..a8243751aa 100644 --- a/extra/99-bottles/99-bottles.factor +++ b/extra/99-bottles/99-bottles.factor @@ -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 diff --git a/extra/benchmark/chameneos-redux/chameneos-redux.factor b/extra/benchmark/chameneos-redux/chameneos-redux.factor index 2b6d79feeb..dd7a6f5374 100644 --- a/extra/benchmark/chameneos-redux/chameneos-redux.factor +++ b/extra/benchmark/chameneos-redux/chameneos-redux.factor @@ -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 -- ) [ ] [ make-creatures ] bi* diff --git a/extra/benchmark/unicode/unicode.factor b/extra/benchmark/unicode/unicode.factor index 80c552add1..b3568cf79c 100644 --- a/extra/benchmark/unicode/unicode.factor +++ b/extra/benchmark/unicode/unicode.factor @@ -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 [ diff --git a/extra/brainfuck/brainfuck-tests.factor b/extra/brainfuck/brainfuck-tests.factor index f40608eac3..6adf6a8310 100644 --- a/extra/brainfuck/brainfuck-tests.factor +++ b/extra/brainfuck/brainfuck-tests.factor @@ -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 } [ " ++++[>+++++<-]>[<+++++>-]+<+[ diff --git a/extra/bunny/model/model.factor b/extra/bunny/model/model.factor index cf0fafe96a..47ef5332ad 100644 --- a/extra/bunny/model/model.factor +++ b/extra/bunny/model/model.factor @@ -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 [ diff --git a/extra/combinators/extras/extras-tests.factor b/extra/combinators/extras/extras-tests.factor index 3df67e01ef..50fed8261c 100644 --- a/extra/combinators/extras/extras-tests.factor +++ b/extra/combinators/extras/extras-tests.factor @@ -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 diff --git a/extra/compiler/cfg/gvn/testing/testing.factor b/extra/compiler/cfg/gvn/testing/testing.factor index 3d0f68fc7a..5ce852bd31 100644 --- a/extra/compiler/cfg/gvn/testing/testing.factor +++ b/extra/compiler/cfg/gvn/testing/testing.factor @@ -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 ; diff --git a/extra/cpu/8080/emulator/emulator.factor b/extra/cpu/8080/emulator/emulator.factor index adb06e68f0..8df417e207 100644 --- a/extra/cpu/8080/emulator/emulator.factor +++ b/extra/cpu/8080/emulator/emulator.factor @@ -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 diff --git a/extra/cuda/devices/devices.factor b/extra/cuda/devices/devices.factor index 389aba9539..7a4f7f39ef 100644 --- a/extra/cuda/devices/devices.factor +++ b/extra/cuda/devices/devices.factor @@ -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 . ] [ diff --git a/extra/euler/b-rep/io/obj/obj.factor b/extra/euler/b-rep/io/obj/obj.factor index 9b720094d0..43112da8c8 100644 --- a/extra/euler/b-rep/io/obj/obj.factor +++ b/extra/euler/b-rep/io/obj/obj.factor @@ -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 ; diff --git a/extra/geo-ip/geo-ip.factor b/extra/geo-ip/geo-ip.factor index 373d0f800f..4da5894179 100644 --- a/extra/geo-ip/geo-ip.factor +++ b/extra/geo-ip/geo-ip.factor @@ -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' ) diff --git a/extra/git/git.factor b/extra/git/git.factor index 738c50725f..5705558282 100644 --- a/extra/git/git.factor +++ b/extra/git/git.factor @@ -135,9 +135,9 @@ CONSTRUCTOR: 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 ] [ diff --git a/extra/gpu/shaders/shaders.factor b/extra/gpu/shaders/shaders.factor index 0a07551161..61bddd35aa 100644 --- a/extra/gpu/shaders/shaders.factor +++ b/extra/gpu/shaders/shaders.factor @@ -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 ) { diff --git a/extra/imap/imap.factor b/extra/imap/imap.factor index 048fce0464..12cee2e408 100644 --- a/extra/imap/imap.factor +++ b/extra/imap/imap.factor @@ -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 ( -- ) diff --git a/extra/irc/messages/base/base.factor b/extra/irc/messages/base/base.factor index e79431a9fd..0166c00681 100644 --- a/extra/irc/messages/base/base.factor +++ b/extra/irc/messages/base/base.factor @@ -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 ; > 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 ; diff --git a/extra/irc/messages/parser/parser.factor b/extra/irc/messages/parser/parser.factor index 829236cb16..9d28f33503 100644 --- a/extra/irc/messages/parser/parser.factor +++ b/extra/irc/messages/parser/parser.factor @@ -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* ; diff --git a/extra/lcd/lcd.factor b/extra/lcd/lcd.factor index 0ac74a6f92..9dffc1603e 100644 --- a/extra/lcd/lcd.factor +++ b/extra/lcd/lcd.factor @@ -16,7 +16,7 @@ IN: lcd '[ _ lcd-digit ] { } map-as concat ; : lcd ( digit-str -- string ) - 4 [ lcd-row ] with map "\n" join ; + 4 [ lcd-row ] with map unlines ; TUPLE: time-display < label timer ; diff --git a/extra/mason/git/git.factor b/extra/mason/git/git.factor index 1a9954f8b4..1d3c88503d 100644 --- a/extra/mason/git/git.factor +++ b/extra/mason/git/git.factor @@ -8,7 +8,7 @@ IN: mason.git : git-id ( -- id ) { "git" "show" } utf8 [ lines ] with-process-reader - first " " split second ; + first words second ; [ basic space-append ] [ drop ] if ; diff --git a/extra/metar/metar.factor b/extra/metar/metar.factor index 1fc78adc43..cba09c6bd3 100644 --- a/extra/metar/metar.factor +++ b/extra/metar/metar.factor @@ -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 new ] dip [ >>raw ] keep diff --git a/extra/modern/html/html.factor b/extra/modern/html/html.factor index 59e7514dc0..c9789e2fda 100644 --- a/extra/modern/html/html.factor +++ b/extra/modern/html/html.factor @@ -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 { diff --git a/extra/morse/morse.factor b/extra/morse/morse.factor index 23301ed3f8..84e250febd 100644 --- a/extra/morse/morse.factor +++ b/extra/morse/morse.factor @@ -87,19 +87,19 @@ CONSTANT: morse-code-table $[ 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 ; diff --git a/extra/pcre/ffi/ffi-tests.factor b/extra/pcre/ffi/ffi-tests.factor index 75b9c3b630..d3b71c569f 100644 --- a/extra/pcre/ffi/ffi-tests.factor +++ b/extra/pcre/ffi/ffi-tests.factor @@ -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 diff --git a/extra/pdf/layout/layout.factor b/extra/pdf/layout/layout.factor index 5af515b73d..990b027269 100644 --- a/extra/pdf/layout/layout.factor +++ b/extra/pdf/layout/layout.factor @@ -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 object? diff --git a/extra/pdf/values/values.factor b/extra/pdf/values/values.factor index 33f0797baf..e2122f02c6 100644 --- a/extra/pdf/values/values.factor +++ b/extra/pdf/values/values.factor @@ -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 ; diff --git a/extra/poker/poker.factor b/extra/poker/poker.factor index bc6edf5fd2..f445c50c98 100644 --- a/extra/poker/poker.factor +++ b/extra/poker/poker.factor @@ -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 ; diff --git a/extra/pop3/pop3.factor b/extra/pop3/pop3.factor index c99eb8678e..576393d577 100644 --- a/extra/pop3/pop3.factor +++ b/extra/pop3/pop3.factor @@ -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* ; diff --git a/extra/project-euler/067/067.factor b/extra/project-euler/067/067.factor index 7f3472f306..c0c0fd1117 100644 --- a/extra/project-euler/067/067.factor +++ b/extra/project-euler/067/067.factor @@ -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> diff --git a/extra/python/syntax/syntax-tests.factor b/extra/python/syntax/syntax-tests.factor index 69f07e02c0..9e4e212d5a 100644 --- a/extra/python/syntax/syntax-tests.factor +++ b/extra/python/syntax/syntax-tests.factor @@ -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 } [ diff --git a/extra/quiz/quiz.factor b/extra/quiz/quiz.factor index 13c3d242ef..48a62c15ee 100644 --- a/extra/quiz/quiz.factor +++ b/extra/quiz/quiz.factor @@ -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 ) [ CHAR: a + 1string ] map ; : alphabet-zip ( seq -- zip ) [ length [ 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>> . ; diff --git a/extra/rosetta-code/amb/amb.factor b/extra/rosetta-code/amb/amb.factor index 1a2009a552..5db404c8d8 100644 --- a/extra/rosetta-code/amb/amb.factor +++ b/extra/rosetta-code/amb/amb.factor @@ -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 diff --git a/extra/rosetta-code/sierpinski-triangle/sierpinski-triangle.factor b/extra/rosetta-code/sierpinski-triangle/sierpinski-triangle.factor index 0f1bbc993c..381a820ce5 100644 --- a/extra/rosetta-code/sierpinski-triangle/sierpinski-triangle.factor +++ b/extra/rosetta-code/sierpinski-triangle/sierpinski-triangle.factor @@ -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 diff --git a/extra/rosetta-code/text-processing/max-licenses/max-licenses.factor b/extra/rosetta-code/text-processing/max-licenses/max-licenses.factor index 9943470916..25a0d94f1e 100644 --- a/extra/rosetta-code/text-processing/max-licenses/max-licenses.factor +++ b/extra/rosetta-code/text-processing/max-licenses/max-licenses.factor @@ -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 > diff --git a/extra/rpn/rpn.factor b/extra/rpn/rpn.factor index fd39ed09a8..f01f28ad9c 100644 --- a/extra/rpn/rpn.factor +++ b/extra/rpn/rpn.factor @@ -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 [ diff --git a/extra/smalltalk/printer/printer.factor b/extra/smalltalk/printer/printer.factor index cbf4baf74d..eac54a0f38 100644 --- a/extra/smalltalk/printer/printer.factor +++ b/extra/smalltalk/printer/printer.factor @@ -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 ; diff --git a/extra/subrip-subtitles/subrip-subtitles.factor b/extra/subrip-subtitles/subrip-subtitles.factor index 0a8541b00d..98af8bbe32 100644 --- a/extra/subrip-subtitles/subrip-subtitles.factor +++ b/extra/subrip-subtitles/subrip-subtitles.factor @@ -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 diff --git a/extra/text-to-pdf/text-to-pdf.factor b/extra/text-to-pdf/text-to-pdf.factor index 897d858a50..c6159dfee8 100644 --- a/extra/text-to-pdf/text-to-pdf.factor +++ b/extra/text-to-pdf/text-to-pdf.factor @@ -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> diff --git a/extra/text-to-speech/text-to-speech.factor b/extra/text-to-speech/text-to-speech.factor index 6b6377fbc0..f2c4e498ef 100644 --- a/extra/text-to-speech/text-to-speech.factor +++ b/extra/text-to-speech/text-to-speech.factor @@ -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 diff --git a/extra/tools/echo/echo.factor b/extra/tools/echo/echo.factor index 0fcf9db16b..13401d87fd 100644 --- a/extra/tools/echo/echo.factor +++ b/extra/tools/echo/echo.factor @@ -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 ; diff --git a/extra/txon/txon.factor b/extra/txon/txon.factor index 59b02a611f..554ff4b65e 100644 --- a/extra/txon/txon.factor +++ b/extra/txon/txon.factor @@ -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 ; diff --git a/extra/webapps/mason/version/binary/binary.factor b/extra/webapps/mason/version/binary/binary.factor index 239011c8f1..c2e0446d14 100644 --- a/extra/webapps/mason/version/binary/binary.factor +++ b/extra/webapps/mason/version/binary/binary.factor @@ -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 diff --git a/extra/zeromq/examples/wuclient.factor b/extra/zeromq/examples/wuclient.factor index 4f39db82d3..f165f7fd53 100644 --- a/extra/zeromq/examples/wuclient.factor +++ b/extra/zeromq/examples/wuclient.factor @@ -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 -- 2.34.1