swap ... 3append -> surround in extra

db4
Doug Coleman 2008-12-06 18:58:05 -06:00
parent 37b9a350cc
commit c75777b7a2
6 changed files with 9 additions and 9 deletions

View File

@ -16,7 +16,7 @@ IN: combinators.lib.tests
[ { "foo" "xbarx" } ] [ { "foo" "xbarx" } ]
[ [
{ "oof" "bar" } { [ reverse ] [ "x" swap "x" 3append ] } parallel-call { "oof" "bar" } { [ reverse ] [ "x" dup surround ] } parallel-call
] unit-test ] unit-test
{ 1 1 } [ { 1 1 } [

View File

@ -16,10 +16,10 @@ IN: html.parser.utils
[ ?head drop ] [ ?tail drop ] bi ; [ ?head drop ] [ ?tail drop ] bi ;
: single-quote ( str -- newstr ) : single-quote ( str -- newstr )
"'" swap "'" 3append ; "'" dup surround ;
: double-quote ( str -- newstr ) : double-quote ( str -- newstr )
"\"" swap "\"" 3append ; "\"" dup surround ;
: quote ( str -- newstr ) : quote ( str -- newstr )
CHAR: ' over member? CHAR: ' over member?

View File

@ -102,7 +102,7 @@ SYMBOL: total
{ 0 [ [ dup ] ] } { 0 [ [ dup ] ] }
{ 1 [ [ over ] ] } { 1 [ [ over ] ] }
{ 2 [ [ pick ] ] } { 2 [ [ pick ] ] }
[ 1- picker [ >r ] swap [ r> swap ] 3append ] [ 1- picker [ >r ] [ r> swap ] surround ]
} case ; } case ;
: (multi-predicate) ( class picker -- quot ) : (multi-predicate) ( class picker -- quot )

View File

@ -41,7 +41,7 @@ HELP: 'bold'
"commonly used in markup languages to indicate bold " "commonly used in markup languages to indicate bold "
"faced text." } "faced text." }
{ $example "USING: parser-combinators parser-combinators.simple prettyprint ;" "\"*foo*\" 'bold' parse-1 ." "\"foo\"" } { $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' HELP: 'italic'
{ $values { $values
@ -53,7 +53,7 @@ HELP: 'italic'
"faced text." } "faced text." }
{ $examples { $examples
{ $example "USING: parser-combinators parser-combinators.simple prettyprint ;" "\"_foo_\" 'italic' parse-1 ." "\"foo\"" } { $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 HELP: comma-list
{ $values { $values
{ "element" "a parser object" } { "parser" "a parser object" } } { "element" "a parser object" } { "parser" "a parser object" } }

View File

@ -32,8 +32,8 @@ SYMBOL: networking-hook
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: start-service ( name -- ) "/etc/init.d/" swap " start" 3append system drop ; : start-service ( name -- ) "/etc/init.d/" " start" surround system drop ;
: stop-service ( name -- ) "/etc/init.d/" swap " stop" 3append system drop ; : stop-service ( name -- ) "/etc/init.d/" " stop" surround system drop ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

View File

@ -230,7 +230,7 @@ M: revision feed-entry-url id>> revision-url ;
[ list-revisions ] >>entries ; [ list-revisions ] >>entries ;
: rollback-description ( description -- description' ) : rollback-description ( description -- description' )
[ "Rollback of '" swap "'" 3append ] [ "Rollback" ] if* ; [ "Rollback of '" "'" surround ] [ "Rollback" ] if* ;
: <rollback-action> ( -- action ) : <rollback-action> ( -- action )
<action> <action>