summaryrefslogtreecommitdiffstats
path: root/doc/unknown.n
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-02-01 18:27:42 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-02-01 18:27:42 (GMT)
commitbf2e20ec8703a3c6e725e464bb4e7fca8af0834c (patch)
treec00a6c3b557759767b41407974391d1117ad0c25 /doc/unknown.n
parent2e9bf45bc4d2510a07a538c48f8103957ede3aaf (diff)
downloadtcl-bf2e20ec8703a3c6e725e464bb4e7fca8af0834c.zip
tcl-bf2e20ec8703a3c6e725e464bb4e7fca8af0834c.tar.gz
tcl-bf2e20ec8703a3c6e725e464bb4e7fca8af0834c.tar.bz2
TIP#181 IMPLEMENTATION
* doc/Namespace.3: New command [namespace unknown]. New public * doc/namespace.n: C routines Tcl_(Get|Set)NamespaceUnknownHandler. * doc/unknown.n: [Patch 958222]. * generic/tcl.decls: * generic/tclBasic.c: * generic/tclInt.h: * generic/tclNamesp.c: * tests/namespace.test: * generic/tclDecls.h: make genstubs * generic/tclStubInit.c:
Diffstat (limited to 'doc/unknown.n')
-rw-r--r--doc/unknown.n21
1 files changed, 12 insertions, 9 deletions
diff --git a/doc/unknown.n b/doc/unknown.n
index 95bb066..6ece5f3 100644
--- a/doc/unknown.n
+++ b/doc/unknown.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: unknown.n,v 1.5 2004/05/30 14:13:52 dkf Exp $
+'\" RCS: @(#) $Id: unknown.n,v 1.6 2006/02/01 18:27:43 dgp Exp $
'\"
.so man.macros
.TH unknown n "" Tcl "Tcl Built-In Commands"
@@ -23,15 +23,18 @@ This command is invoked by the Tcl interpreter whenever a script
tries to invoke a command that doesn't exist. The default implementation
of \fBunknown\fR is a library procedure defined when Tcl initializes an
interpreter. You can override the default \fBunknown\fR to change its
-functionality. Note that there is no default implementation of
-\fBunknown\fR in a safe interpreter.
+functionality, or you can register a new handler for individual namespaces
+using the \fBnamespace unknown\fR command. Note that there is no default
+implementation of \fBunknown\fR in a safe interpreter.
.PP
If the Tcl interpreter encounters a command name for which there
-is not a defined command, then Tcl checks for the existence of
-a command named \fBunknown\fR.
-If there is no such command, then the interpreter returns an
-error.
-If the \fBunknown\fR command exists, then it is invoked with
+is not a defined command (in either the current namespace, or the
+global namespace), then Tcl checks for the existence of
+an unknown handler for the current namespace. By default, this
+handler is a command named \fB::unknown\fR. If there is no such
+command, then the interpreter returns an error.
+If the \fBunknown\fR command exists (or a new handler has been
+registered for the current namespace), then it is invoked with
arguments consisting of the fully-substituted name and arguments
for the original non-existent command.
The \fBunknown\fR command typically does things like searching
@@ -87,7 +90,7 @@ proc \fBunknown\fR args {
.CE
.SH "SEE ALSO"
-info(n), proc(n), interp(n), library(n)
+info(n), proc(n), interp(n), library(n), namespace(n)
.SH KEYWORDS
error, non-existent command