Version 5 of unknown

Updated 2002-03-12 13:58:31

http://www.purl.org/tcl/home/man/tcl8.4/TclCmd/unknown.htm

The unknown procedure is called if a command is not known to the interpreter. The default unknown handler tries to find a sourcable file to define the command in question, or, in interactive mode, tries to redirect the command to the operating system. For examples how to put unknown to other uses, see Radical language modification.


As hinted above, manipulation of unknown can be a powerful metaprogramming technique, giving Tcl radically new behavior. unknown is implemented as a proc; among other reasons, it does elaborate string-handling that'd be tedious in C. One might imagine, though, in a "Small Tcl" context, construction of a minimal C-coded unknown implementation that both provides sufficient functionality for embedded situations (autoloading?) and occupies severely constrained memory.

Tcl syntax help - Arts and crafts of Tcl-Tk programming - Category Command