From db30415dcb2a8864451f87233ab210783a40bfa5 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 3 Dec 2008 19:10:41 -0600 Subject: [PATCH] basis: swap 3append -> glue --- basis/alien/structs/fields/fields.factor | 2 +- basis/db/queries/queries.factor | 11 ++++------- basis/db/types/types.factor | 10 ++-------- basis/environment/environment.factor | 2 +- basis/furnace/utilities/utilities.factor | 2 +- basis/io/files/unique/unique.factor | 2 +- basis/io/servers/connection/connection.factor | 2 +- basis/io/sockets/sockets.factor | 2 +- basis/io/unix/launcher/launcher.factor | 2 +- basis/prettyprint/prettyprint.factor | 2 +- basis/tools/memory/memory.factor | 2 +- basis/tools/vocabs/vocabs.factor | 2 +- basis/tools/walker/walker.factor | 2 +- basis/urls/encoding/encoding.factor | 2 +- 14 files changed, 18 insertions(+), 27 deletions(-) diff --git a/basis/alien/structs/fields/fields.factor b/basis/alien/structs/fields/fields.factor index 17294aed87..abce91f56f 100644 --- a/basis/alien/structs/fields/fields.factor +++ b/basis/alien/structs/fields/fields.factor @@ -29,7 +29,7 @@ PREDICATE: slot-writer < word "writing" word-prop >boolean ; writer>> swap "writing" set-word-prop ; : reader-word ( class name vocab -- word ) - [ "-" swap 3append ] dip create ; + [ "-" glue ] dip create ; : writer-word ( class name vocab -- word ) [ [ swap "set-" % % "-" % % ] "" make ] dip create ; diff --git a/basis/db/queries/queries.factor b/basis/db/queries/queries.factor index b181aab23b..a96398ff2c 100644 --- a/basis/db/queries/queries.factor +++ b/basis/db/queries/queries.factor @@ -162,22 +162,19 @@ M: db ( tuple class -- statement ) where-clause ] query-make ; -: splice ( string1 string2 string3 -- string ) - swap 3append ; - : do-group ( tuple groups -- ) dup string? [ 1array ] when - [ ", " join " group by " splice ] curry change-sql drop ; + [ ", " join " group by " glue ] curry change-sql drop ; : do-order ( tuple order -- ) dup string? [ 1array ] when - [ ", " join " order by " splice ] curry change-sql drop ; + [ ", " join " order by " glue ] curry change-sql drop ; : do-offset ( tuple n -- ) - [ number>string " offset " splice ] curry change-sql drop ; + [ number>string " offset " glue ] curry change-sql drop ; : do-limit ( tuple n -- ) - [ number>string " limit " splice ] curry change-sql drop ; + [ number>string " limit " glue ] curry change-sql drop ; : make-query* ( tuple query -- tuple' ) dupd diff --git a/basis/db/types/types.factor b/basis/db/types/types.factor index 6a889689ce..da9fe39b80 100644 --- a/basis/db/types/types.factor +++ b/basis/db/types/types.factor @@ -158,12 +158,6 @@ ERROR: no-sql-type type ; modifiers>> [ lookup-modifier ] map " " join [ "" ] [ " " prepend ] if-empty ; -: join-space ( string1 string2 -- new-string ) - " " swap 3append ; - -: paren ( string -- new-string ) - "(" swap ")" 3append ; - HOOK: bind% db ( spec -- ) HOOK: bind# db ( spec obj -- ) @@ -171,7 +165,7 @@ ERROR: no-column column ; : >reference-string ( string pair -- string ) first2 - [ [ unparse join-space ] [ db-columns ] bi ] dip + [ [ unparse " " glue ] [ db-columns ] bi ] dip swap [ column-name>> = ] with find nip [ no-column ] unless* - column-name>> paren append ; + column-name>> "(" ")" surround append ; diff --git a/basis/environment/environment.factor b/basis/environment/environment.factor index d6ce34dbcf..e60a52c995 100644 --- a/basis/environment/environment.factor +++ b/basis/environment/environment.factor @@ -18,7 +18,7 @@ HOOK: (set-os-envs) os ( seq -- ) (os-envs) [ "=" split1 ] H{ } map>assoc ; : set-os-envs ( assoc -- ) - [ "=" swap 3append ] { } assoc>map (set-os-envs) ; + [ "=" glue ] { } assoc>map (set-os-envs) ; { { [ os unix? ] [ "environment.unix" require ] } diff --git a/basis/furnace/utilities/utilities.factor b/basis/furnace/utilities/utilities.factor index f2b71fb89f..7f71a131ed 100644 --- a/basis/furnace/utilities/utilities.factor +++ b/basis/furnace/utilities/utilities.factor @@ -7,7 +7,7 @@ http.server.redirection http.server.remapping ; IN: furnace.utilities : word>string ( word -- string ) - [ vocabulary>> ] [ name>> ] bi ":" swap 3append ; + [ vocabulary>> ] [ name>> ] bi ":" glue ; : words>strings ( seq -- seq' ) [ word>string ] map ; diff --git a/basis/io/files/unique/unique.factor b/basis/io/files/unique/unique.factor index 74100c7dc7..ec89517bbc 100644 --- a/basis/io/files/unique/unique.factor +++ b/basis/io/files/unique/unique.factor @@ -29,7 +29,7 @@ PRIVATE> : make-unique-file ( prefix suffix -- path ) temporary-path -rot [ - unique-length get random-name swap 3append append-path + unique-length get random-name glue append-path dup (make-unique-file) ] 3curry unique-retries get retry ; diff --git a/basis/io/servers/connection/connection.factor b/basis/io/servers/connection/connection.factor index 6c7ff7e0f1..2d990e6483 100644 --- a/basis/io/servers/connection/connection.factor +++ b/basis/io/servers/connection/connection.factor @@ -79,7 +79,7 @@ M: threaded-server handle-client* handler>> call ; \ handle-client ERROR add-error-logging : thread-name ( server-name addrspec -- string ) - unparse-short " connection from " swap 3append ; + unparse-short " connection from " glue ; : accept-connection ( threaded-server -- ) [ accept ] [ addr>> ] bi diff --git a/basis/io/sockets/sockets.factor b/basis/io/sockets/sockets.factor index ce7c4f6ddd..fbfae333c0 100644 --- a/basis/io/sockets/sockets.factor +++ b/basis/io/sockets/sockets.factor @@ -115,7 +115,7 @@ M: invalid-inet6 summary drop "Invalid IPv6 address" ; : pad-inet6 ( string1 string2 -- seq ) 2dup [ length ] bi@ + 8 swap - dup 0 < [ "More than 8 components" throw ] when - swap 3append ; + glue ; : inet6-bytes ( seq -- bytes ) [ 2 >be ] { } map-as concat >byte-array ; diff --git a/basis/io/unix/launcher/launcher.factor b/basis/io/unix/launcher/launcher.factor index 7a1cac3ff1..c81da60e12 100644 --- a/basis/io/unix/launcher/launcher.factor +++ b/basis/io/unix/launcher/launcher.factor @@ -16,7 +16,7 @@ USE: unix command>> dup string? [ tokenize-command ] when ; : assoc>env ( assoc -- env ) - [ "=" swap 3append ] { } assoc>map ; + [ "=" glue ] { } assoc>map ; : setup-priority ( process -- process ) dup priority>> [ diff --git a/basis/prettyprint/prettyprint.factor b/basis/prettyprint/prettyprint.factor index 82acef9b72..7c4de1e973 100644 --- a/basis/prettyprint/prettyprint.factor +++ b/basis/prettyprint/prettyprint.factor @@ -129,7 +129,7 @@ SYMBOL: -> : remove-breakpoints ( quot pos -- quot' ) over quotation? [ 1+ cut [ (remove-breakpoints) ] bi@ - [ -> ] swap 3append + [ -> ] glue ] [ drop ] if ; diff --git a/basis/tools/memory/memory.factor b/basis/tools/memory/memory.factor index 70f9a10a51..8c35ae25a8 100644 --- a/basis/tools/memory/memory.factor +++ b/basis/tools/memory/memory.factor @@ -10,7 +10,7 @@ IN: tools.memory : write-size ( n -- ) number>string - dup length 4 > [ 3 cut* "," swap 3append ] when + dup length 4 > [ 3 cut* "," glue ] when " KB" append write-cell ; : write-total/used/free ( free total str -- ) diff --git a/basis/tools/vocabs/vocabs.factor b/basis/tools/vocabs/vocabs.factor index ef0c74d7c8..ab2d089d94 100644 --- a/basis/tools/vocabs/vocabs.factor +++ b/basis/tools/vocabs/vocabs.factor @@ -238,7 +238,7 @@ M: vocab-link summary vocab-summary ; vocab-dir append-path dup exists? [ subdirs ] [ drop { } ] if ] keep [ - swap [ "." swap 3append ] with map + swap [ "." glue ] with map ] unless-empty ; : vocabs-in-dir ( root name -- ) diff --git a/basis/tools/walker/walker.factor b/basis/tools/walker/walker.factor index f1a1e3c873..953291cc59 100644 --- a/basis/tools/walker/walker.factor +++ b/basis/tools/walker/walker.factor @@ -126,7 +126,7 @@ SYMBOL: +stopped+ [ 2dup length = [ nip [ break ] append ] [ 2dup nth \ break = [ nip ] [ - swap 1+ cut [ break ] swap 3append + swap 1+ cut [ break ] glue ] if ] if ] change-frame ; diff --git a/basis/urls/encoding/encoding.factor b/basis/urls/encoding/encoding.factor index fa882609a5..f621384ede 100644 --- a/basis/urls/encoding/encoding.factor +++ b/basis/urls/encoding/encoding.factor @@ -91,6 +91,6 @@ PRIVATE> [ [ [ url-encode ] dip - [ url-encode "=" swap 3append , ] with each + [ url-encode "=" glue , ] with each ] assoc-each ] { } make "&" join ;