1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-24 02:48:07 +11:00
collapseos/blk/017
Virgil Dupras a96b5f1dec Restore DOES> section in usage guide
I removed it because it was redundant with Starting Forth, but
I directly reference it in the dictionary, so well...
2020-05-03 20:24:54 -04:00

17 lines
523 B
Plaintext

DOES>
Used inside a colon definition that itself uses CREATE, DOES>
transforms that newly created word into a "does cell", that is,
a regular cell ( when called, puts the cell's addr on PS), but
right after that, it executes words that appear after the
DOES>.
"does cells" always allocate 4 bytes (2 for the cell, 2 for the
DOES> link) and there is no need for ALLOT in colon definition.
At compile time, colon definition stops processing words when
reaching the DOES>.
Example: ": CONSTANT CREATE HERE @ ! DOES> @ ;"