namespace unknown
Gives or sets the handler of a command name that is not found in the current namespace.
namespace unknown ?PREFIX?
Description
Sets the handler of the current namespace to the command prefix PREFIX. For a command name that a script in the namespace does not find, ztcl calls PREFIX with the words of the call in place of the global unknown. An empty PREFIX goes back to the default.
With no PREFIX, it gives the handler. The global namespace has ::unknown by default, and another namespace an empty string, which means the handler of the global namespace.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| PREFIX | command prefix | none | The new handler. |
Returns
The handler with no PREFIX, or an empty string.
Examples
% namespace unknown
::unknown
% namespace eval uk {namespace unknown}
% namespace eval uk {namespace unknown {apply {{args} {return "uk: $args"}}}; zz 1}
uk: zz 1
Errors
% namespace unknown a b
wrong # args: should be "namespace unknown ?script?"
-errorcode TCL WRONGARGS
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1