]> gitweb.factorcode.org Git - factor.git/commitdiff
swap ... 3append -> surround in extra
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 7 Dec 2008 00:58:05 +0000 (18:58 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 7 Dec 2008 00:58:05 +0000 (18:58 -0600)
extra/combinators/lib/lib-tests.factor
extra/html/parser/utils/utils.factor
extra/multi-methods/multi-methods.factor
extra/parser-combinators/simple/simple-docs.factor
extra/raptor/raptor.factor
extra/webapps/wiki/wiki.factor

index 838bb08b92b5bdc0d722b042aad19380bafe2638..9489798b9b379175b505ca5b3c1a264511d034ad 100755 (executable)
@@ -16,7 +16,7 @@ IN: combinators.lib.tests
 
 [ { "foo" "xbarx" } ]
 [
-    { "oof" "bar" } { [ reverse ] [ "x" swap "x" 3append ] } parallel-call
+    { "oof" "bar" } { [ reverse ] [ "x" dup surround ] } parallel-call
 ] unit-test
 
 { 1 1 } [
index 976a5ba91f6ca8fdf9e108b7bf614f5d2af4639d..2f414d2aa537614c5ac03d4eb8871ee332981d89 100644 (file)
@@ -16,10 +16,10 @@ IN: html.parser.utils
     [ ?head drop ] [ ?tail drop ] bi ;
 
 : single-quote ( str -- newstr )
-    "'" swap "'" 3append ;
+    "'" dup surround ;
 
 : double-quote ( str -- newstr )
-    "\"" swap "\"" 3append ;
+    "\"" dup surround ;
 
 : quote ( str -- newstr )
     CHAR: ' over member?
index 682abf3a5d0d9342c2415005f2dee93c6b7472f4..14062b15db683157dfb214d5cc036da4904023ae 100755 (executable)
@@ -102,7 +102,7 @@ SYMBOL: total
         { 0 [ [ dup ] ] }
         { 1 [ [ over ] ] }
         { 2 [ [ pick ] ] }
-        [ 1- picker [ >r ] swap [ r> swap ] 3append ]
+        [ 1- picker [ >r ] [ r> swap ] surround ]
     } case ;
 
 : (multi-predicate) ( class picker -- quot )
index fdf32bddb14c06c6481e3d41da12f9a0f561e4bf..be6c01aab80bc2606932d5dd1300f269d626a548 100755 (executable)
@@ -41,7 +41,7 @@ HELP: 'bold'
     "commonly used in markup languages to indicate bold "
     "faced text." }
 { $example "USING: parser-combinators parser-combinators.simple prettyprint ;" "\"*foo*\" 'bold' parse-1 ." "\"foo\"" }
-{ $example "USING: kernel parser-combinators parser-combinators.simple prettyprint sequences ;" "\"*foo*\" 'bold' [ \"<strong>\" swap \"</strong>\" 3append ] <@ parse-1 ." "\"<strong>foo</strong>\"" } ;
+{ $example "USING: kernel parser-combinators parser-combinators.simple prettyprint sequences ;" "\"*foo*\" 'bold' [ \"<strong>\" \"</strong>\" surround ] <@ parse-1 ." "\"<strong>foo</strong>\"" } ;
 
 HELP: 'italic'
 { $values 
@@ -53,7 +53,7 @@ HELP: 'italic'
     "faced text." }
 { $examples
 { $example "USING: parser-combinators parser-combinators.simple prettyprint ;" "\"_foo_\" 'italic' parse-1 ." "\"foo\"" }
-{ $example "USING: kernel parser-combinators parser-combinators.simple prettyprint sequences ;" "\"_foo_\" 'italic' [ \"<emphasis>\" swap \"</emphasis>\" 3append ] <@ parse-1 ." "\"<emphasis>foo</emphasis>\"" } } ;
+{ $example "USING: kernel parser-combinators parser-combinators.simple prettyprint sequences ;" "\"_foo_\" 'italic' [ \"<emphasis>\" \"</emphasis>\" surround ] <@ parse-1 ." "\"<emphasis>foo</emphasis>\"" } } ;
 HELP: comma-list
 { $values 
   { "element" "a parser object" } { "parser" "a parser object" } }
index 933275e5bfc9a1e25a78d1382c418496ebbc5643..c0605fe83743c672b603be17bb60035a90902f47 100755 (executable)
@@ -32,8 +32,8 @@ SYMBOL: networking-hook
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: start-service ( name -- ) "/etc/init.d/" swap " start" 3append system drop ;
-: stop-service  ( name -- ) "/etc/init.d/" swap " stop"  3append system drop ;
+: start-service ( name -- ) "/etc/init.d/" " start" surround system drop ;
+: stop-service  ( name -- ) "/etc/init.d/" " stop"  surround system drop ;
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
index b78dc25d7997fb074d331012800c6b2e4ff7db57..f2c0600ed5a31bf53e03ed44d85067963c39942f 100644 (file)
@@ -230,7 +230,7 @@ M: revision feed-entry-url id>> revision-url ;
         [ list-revisions ] >>entries ;
 
 : rollback-description ( description -- description' )
-    [ "Rollback of '" swap "'" 3append ] [ "Rollback" ] if* ;
+    [ "Rollback of '" "'" surround ] [ "Rollback" ] if* ;
 
 : <rollback-action> ( -- action )
     <action>