-
Notifications
You must be signed in to change notification settings - Fork 9
Scopes
Wolf Wejgaard edited this page Mar 25, 2017
·
6 revisions
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 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