Minor core cleanup
parent
4f0a92e8b3
commit
d62a6c4b09
|
@ -606,7 +606,7 @@ HELP: 3compose
|
|||
} ;
|
||||
|
||||
HELP: dip
|
||||
{ $values { "obj" object } { "quot" quotation } }
|
||||
{ $values { "x" object } { "quot" quotation } }
|
||||
{ $description "Calls " { $snippet "quot" } " with " { $snippet "obj" } " hidden on the retain stack." }
|
||||
{ $notes "The following are equivalent:"
|
||||
{ $code ">r foo bar r>" }
|
||||
|
@ -614,7 +614,7 @@ HELP: dip
|
|||
} ;
|
||||
|
||||
HELP: 2dip
|
||||
{ $values { "obj1" object } { "obj2" object } { "quot" quotation } }
|
||||
{ $values { "x" object } { "y" object } { "quot" quotation } }
|
||||
{ $description "Calls " { $snippet "quot" } " with " { $snippet "obj1" } " and " { $snippet "obj2" } " hidden on the retain stack." }
|
||||
{ $notes "The following are equivalent:"
|
||||
{ $code ">r >r foo bar r> r>" }
|
||||
|
@ -622,7 +622,7 @@ HELP: 2dip
|
|||
} ;
|
||||
|
||||
HELP: 3dip
|
||||
{ $values { "obj1" object } { "obj2" object } { "obj3" object } { "quot" quotation } }
|
||||
{ $values { "x" object } { "y" object } { "z" object } { "quot" quotation } }
|
||||
{ $description "Calls " { $snippet "quot" } " with " { $snippet "obj1" } ", " { $snippet "obj2" } " and " { $snippet "obj3" } " hidden on the retain stack." }
|
||||
{ $notes "The following are equivalent:"
|
||||
{ $code ">r >r >r foo bar r> r> r>" }
|
||||
|
|
|
@ -55,18 +55,18 @@ DEFER: if
|
|||
|
||||
: 3slip ( quot x y z -- x y z ) >r >r >r call r> r> r> ; inline
|
||||
|
||||
: dip ( obj quot -- obj ) swap slip ; inline
|
||||
: dip ( x quot -- x ) swap slip ; inline
|
||||
|
||||
: 2dip ( obj1 obj2 quot -- obj1 obj2 ) -rot 2slip ; inline
|
||||
: 2dip ( x y quot -- x y ) swap >r dip r> ; inline
|
||||
|
||||
: 3dip ( obj1 obj2 obj3 quot -- obj1 obj2 obj3 ) -roll 3slip ; inline
|
||||
: 3dip ( x y z quot -- x y z ) swap >r 2dip r> ; inline
|
||||
|
||||
! Keepers
|
||||
: keep ( x quot -- x ) over slip ; inline
|
||||
: keep ( x quot -- x ) dupd dip ; inline
|
||||
|
||||
: 2keep ( x y quot -- x y ) 2over 2slip ; inline
|
||||
: 2keep ( x y quot -- x y ) >r 2dup r> 2dip ; inline
|
||||
|
||||
: 3keep ( x y z quot -- x y z ) >r 3dup r> -roll 3slip ; inline
|
||||
: 3keep ( x y z quot -- x y z ) >r 3dup r> 3dip ; inline
|
||||
|
||||
! Cleavers
|
||||
: bi ( x p q -- )
|
||||
|
|
Loading…
Reference in New Issue