-
Notifications
You must be signed in to change notification settings - Fork 9
Compiler
Every TclForth word compiles itself. The TclForth interpreter parses the word from the source and passes control to the word.
This is similar to Tcl where the interpreter passes control to the commands. However, Tcl commands need the interpreter again to fetch their arguments from the input stream. TclForth words get their arguments ready to use on the parameter stack.
A normal executable non-compiler word (proc, code, colon) appends a call to itself in the generated Tcl code, it adds its name and a closing ";".
Example: dup appends " dup ; "
The object parses the following word in the source. If the word is a valid command of this type, the correspondig method script is evaluated. Else, if no command, the default ({}) method applies.
Compiler words perform their defined actions. For example, the flow control words build a corresponding Tcl flow structure. The compiler words are defined in Tcl code.
You can inspect the compiled Tcl code in the code window in the console. Open the window in the Setupmenu.