Thu May 28 17:16:22 CEST 2009
Compile mode accessible at console
With the recent simplification of the interaction language, it wasn't
so difficult to allow a switch to compile mode from the interactive
console. The words
forth macro :
Will trigger compile mode. The word and all subsequent words on the
line will be compiled as if they occured in a Forth file, and uploaded
to the target.
Similarly, the following words perform compilation, but will switch
back to interpret mode after the single symbolic argument they take.
variable 2varaiable require planet staapl
Note that in standard Forth the ';' word will exit compilation mode,
but in Staapl Forth it just indicates procedure exit. A word or macro
can have multiple exit points.
This also allowed the creation of the '::' word, which will compile a
line as Forth code, upload it and execute it. This makes it easier to
test macros. To run the code again use 'last'.