colorForth Word Documentation
=============================

There isn't much existing documentation for colorForth words, so this is my attempt to fill in the gaps.


Kernel Words
============

These words are defined in the kernel, not in Forth. As such, I need to guess as to what some of them do.

1, 2, 3, ,
These words insert ("comma in") 1, 2, 3, and 4 bytes into the dictionary respectively, from the stack. The bytes are inserted in reverse order, so something like 74 2, will insert 74 00 into the dictionary.

macro forth
Switch to the macro/forth word list. This means that all future definitions, until the next forth/macro, will be inserted into that word list.

;
End a word. todo: look more into this, sometimes it's a ret, sometimes does tco

?dup
?dup is used at a very low level when we want to push something new onto the stack. It duplicates the top element, allowing us to overwrite the new top element to "push".
However, if the last compile instruction was a drop, ?dup will instead just uncompile the drop. In this case, we again have something to overwrite, and we have saved instructions!
The question mark in its name comes from the fact that it will sometimes dup, and sometimes uncompile a drop. It is not related to the classic forth ?dup, which confused me a lot until I figured out what it did.


~/cf/cfdocs.html