fix stack effects/documentation part 2
parent
a993b7be67
commit
00f3d99dd9
|
@ -27,7 +27,7 @@ M: quotation like drop dup quotation? [ >quotation ] unless ;
|
||||||
|
|
||||||
: unit ( obj -- quot ) 1array >quotation ;
|
: unit ( obj -- quot ) 1array >quotation ;
|
||||||
|
|
||||||
GENERIC: literalize ( obj -- newobj )
|
GENERIC: literalize ( obj -- wrapped )
|
||||||
M: object literalize ;
|
M: object literalize ;
|
||||||
M: word literalize <wrapper> ;
|
M: word literalize <wrapper> ;
|
||||||
M: wrapper literalize <wrapper> ;
|
M: wrapper literalize <wrapper> ;
|
||||||
|
|
|
@ -38,7 +38,7 @@ HELP: <wrapper> ( obj -- wrapper )
|
||||||
{ $values { "obj" "an object" } { "wrapper" "a new wrapper" } }
|
{ $values { "obj" "an object" } { "wrapper" "a new wrapper" } }
|
||||||
{ $description "Creates an object which pushes " { $snippet "obj" } " on the stack when evaluated. User code should call " { $link literalize } " instead, since it avoids wrapping self-evaluating objects (which is redundant)." } ;
|
{ $description "Creates an object which pushes " { $snippet "obj" } " on the stack when evaluated. User code should call " { $link literalize } " instead, since it avoids wrapping self-evaluating objects (which is redundant)." } ;
|
||||||
|
|
||||||
HELP: literalize ( obj -- wrapped )
|
HELP: literalize
|
||||||
{ $values { "obj" "an object" } { "wrapped" "an object" } }
|
{ $values { "obj" "an object" } { "wrapped" "an object" } }
|
||||||
{ $description "Outputs an object which evaluates to " { $snippet "obj" } " when placed in a quotation. If " { $snippet "obj" } " is not self-evaluating (for example, it is a word), then it will be wrapped." }
|
{ $description "Outputs an object which evaluates to " { $snippet "obj" } " when placed in a quotation. If " { $snippet "obj" } " is not self-evaluating (for example, it is a word), then it will be wrapped." }
|
||||||
{ $examples
|
{ $examples
|
||||||
|
|
|
@ -47,7 +47,7 @@ M: gadget equal? eq? ;
|
||||||
|
|
||||||
: gadget-child ( gadget -- child ) gadget-children first ;
|
: gadget-child ( gadget -- child ) gadget-children first ;
|
||||||
|
|
||||||
: nth-gadget ( n gadget -- ) gadget-children nth ;
|
: nth-gadget ( n gadget -- child ) gadget-children nth ;
|
||||||
|
|
||||||
: <zero-rect> ( -- rect ) { 0 0 } dup <rect> ;
|
: <zero-rect> ( -- rect ) { 0 0 } dup <rect> ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue