Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Forth (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Unnamed words and execution tokens ==== In {{Not a typo|ANS}} <!-- not a misspelling --> Forth, unnamed words can be defined with the word <code>:NONAME</code> which compiles the following words up to the next <code>;</code> (semi-colon) and leaves an ''execution token'' on the data stack. The execution token provides an opaque handle for the compiled semantics, similar to the [[function pointer]]s of the [[C (programming language)|C programming language]]. Execution tokens can be stored in variables. The word <code>EXECUTE</code> takes an execution token from the data stack and performs the associated semantics. The word <code>COMPILE,</code> (compile-comma) takes an execution token from the data stack and appends the associated semantics to the current definition. The word <code><nowiki>'</nowiki></code> (tick) takes the name of a word as a parameter and returns the execution token associated with that word on the data stack. In interpretation state, <code>' RANDOM-WORD EXECUTE</code> is equivalent to <code>RANDOM-WORD</code>.<ref name="iUYBX">{{harvnb|Brodie|1987|p=199}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)