diff options
author | dgp <dgp@users.sourceforge.net> | 2007-12-06 21:58:39 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-12-06 21:58:39 (GMT) |
commit | ba41bf0e341e4106a28803e65e0231cd97f38ed6 (patch) | |
tree | 106aabd503a9383552ff0ef86c97879a53907047 /doc | |
parent | c705b6f05a1fc295aba71e392c7e958f136436c6 (diff) | |
download | tcl-ba41bf0e341e4106a28803e65e0231cd97f38ed6.zip tcl-ba41bf0e341e4106a28803e65e0231cd97f38ed6.tar.gz tcl-ba41bf0e341e4106a28803e65e0231cd97f38ed6.tar.bz2 |
* doc/namespace.n: Documentation for zero-argument form of
[namespace import] (TIP 261) [Bug 1596416]
Diffstat (limited to 'doc')
-rw-r--r-- | doc/namespace.n | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/doc/namespace.n b/doc/namespace.n index 2e2f07a..b3ae272 100644 --- a/doc/namespace.n +++ b/doc/namespace.n @@ -7,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: namespace.n,v 1.27 2007/10/30 21:46:02 dkf Exp $ +'\" RCS: @(#) $Id: namespace.n,v 1.28 2007/12/06 21:58:40 dgp Exp $ '\" .so man.macros .TH namespace n 8.5 Tcl "Tcl Built-In Commands" @@ -156,8 +156,18 @@ If so, this command deletes the corresponding imported commands. In effect, this un-does the action of a \fBnamespace import\fR command. .TP \fBnamespace import \fR?\fB\-force\fR? ?\fIpattern\fR \fIpattern ...\fR? -Imports commands into a namespace. -Each \fIpattern\fR is a qualified name like +.VS 8.5 +Imports commands into a namespace, or queries the set of imported +commands in a namespace. When no arguments are present, +\fBnamespace import\fR returns the list of commands in +the current namespace that have been imported from other +namespaces. The commands in the returned list are in +the format of simple names, with no namespace qualifiers at all. +This format is suitable for composition with \fBnamespace forget\fR +(see \fBEXAMPLES\fR below). +.VE 8.5 +When \fIpattern\fR arguments are present, +each \fIpattern\fR is a qualified name like \fBfoo::x\fR or \fBa::p*\fR. That is, it includes the name of an exporting namespace and may have glob-style special characters in the command name @@ -839,6 +849,12 @@ Look up where the command imported in the previous example came from: .CS puts "grill came from [\fBnamespace origin\fR grill]" .CE +.PP +Remove all imported commands from the current namespace: +.CS +namespace forget {*}[namespace import] +.CE + .SH "SEE ALSO" interp(n), upvar(n), variable(n) .SH KEYWORDS |