basis: swap 3append -> glue

db4
Doug Coleman 2008-12-03 19:10:41 -06:00
parent f6a205cc3a
commit db30415dcb
14 changed files with 18 additions and 27 deletions

View File

@ -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 ;

View File

@ -162,22 +162,19 @@ M: db <select-by-slots-statement> ( 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

View File

@ -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 ;

View File

@ -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 ] }

View File

@ -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 ;

View File

@ -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 ;

View File

@ -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

View File

@ -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
<byte-array> swap 3append ;
<byte-array> glue ;
: inet6-bytes ( seq -- bytes )
[ 2 >be ] { } map-as concat >byte-array ;

View File

@ -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>> [

View File

@ -129,7 +129,7 @@ SYMBOL: ->
: remove-breakpoints ( quot pos -- quot' )
over quotation? [
1+ cut [ (remove-breakpoints) ] bi@
[ -> ] swap 3append
[ -> ] glue
] [
drop
] if ;

View File

@ -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 -- )

View File

@ -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 -- )

View File

@ -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 ;

View File

@ -91,6 +91,6 @@ PRIVATE>
[
[
[ url-encode ] dip
[ url-encode "=" swap 3append , ] with each
[ url-encode "=" glue , ] with each
] assoc-each
] { } make "&" join ;