Skip to content
Wolf Wejgaard edited this page Mar 25, 2017 · 6 revisions

Global Words

The Tclforth words live in a global namespace. Each word has a unique name. This is the simple Forth solution. However, you can create namespaces in the application. Tcl provides a comprehensive namespace facility that you can add to your TclForth.

Local Variables

Local variables are handled as objecttypes. Initially a local has the type variable, thus the messages and methods of a variable apply. The variable can be cast to any other type.

Example:

 : PrintLength   ( mystring -- )
    cast mystring string
    mystring length .cr
Clone this wiki locally