-
What does it mean to (hypothetical example) DEFER return IMMEDIATE
: alt_exit ( -- )
['] xyzzy ['] return DEFER!
...
POSTPONE return
['] EXIT ['] return DEFER!
; IMMEDIATE
: woot ( x -- )
?DUP IF alt_exit THEN
...
; So what happens when Does something similar happen for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Nothing special. Same as for other user-defined words:
Do you mean the compilation semantics of
A standard program cannot tick Because : alt_exit ( -- )
['] xyzzy ['] return DEFER!
...
['] return execute-compiling
[: POSTPONE EXIT ;] ['] return DEFER!
; IMMEDIATE
: woot ( x -- )
?DUP IF alt_exit THEN
...
; So, the execution semantics of : alt_exit ( -- )
['] xyzzy ['] return DEFER!
...
['] xyzzy execute-compiling
[: POSTPONE EXIT ;] ['] return DEFER!
; IMMEDIATE
It follows |
Beta Was this translation helpful? Give feedback.
Nothing special. Same as for other user-defined words:
foo
is an ordinary word, thenpostpone foo
is equivalent to['] foo compile,
;foo
is an immediate word, thenpostpone foo
is equivalent to['] foo execute-compiling
.Do you mean the compilation semantics of
postpone
or the run-time semantics that they appends?A standard program cannot tick
exit
(or, at least, execute the returned xt). Because it is not allowed to obtain the execution token of a word for which interpretation semantics are not defined b…