mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-24 01:38:06 +11:00
f6ded7712e
This is the first commit I do entirely in VE. It's a habit I'm planning on taking as it helps a lot to find usability issues.
17 lines
542 B
Plaintext
17 lines
542 B
Plaintext
Compilation vs meta-compilation
|
|
|
|
Compilation vs meta-compilation. When you compile a word with
|
|
"[COMPILE] foo", it's straightforward: It writes the address
|
|
of word foo to HERE.
|
|
|
|
When you *meta* compile, it's a bit more mind blowing. It
|
|
fetches the address of the word specified by the caller, then
|
|
writes that number as a literal, followed by a reference to
|
|
",".
|
|
|
|
Example: ": foo [COMPILE] bar;" is the equivalent of ": foo bar
|
|
;" if bar is not an immediate. However, ": foo COMPILE bar ;"
|
|
is the equivalent of ": foo ['] bar , ;". Got it?
|
|
|
|
|