swap ... 3append -> surround in extra
parent
37b9a350cc
commit
c75777b7a2
|
@ -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 } [
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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" } }
|
||||
|
|
|
@ -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 ;
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue