diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-12-27 22:06:10 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-12-27 22:06:10 (GMT) |
commit | 4230837501b73be694a6e285dc87471b4cabdb65 (patch) | |
tree | 0a2e0561642b48b3ec9baddf570c912cbcb5bac6 /doc | |
parent | eb97742ebfc4d2677574f3985737a4c667310261 (diff) | |
download | tcl-4230837501b73be694a6e285dc87471b4cabdb65.zip tcl-4230837501b73be694a6e285dc87471b4cabdb65.tar.gz tcl-4230837501b73be694a6e285dc87471b4cabdb65.tar.bz2 |
[Bug 2921538]: Updated example to not be quite so ancient.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/namespace.n | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/namespace.n b/doc/namespace.n index 717de11..f89ec91 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.38 2009/11/08 19:56:45 dkf Exp $ +'\" RCS: @(#) $Id: namespace.n,v 1.39 2009/12/27 22:06:12 dkf Exp $ '\" .so man.macros .TH namespace n 8.5 Tcl "Tcl Built-In Commands" @@ -693,11 +693,12 @@ may be imported by other namespaces. If a \fBnamespace import\fR command specifies a command that is not exported, the command is not imported. .SH "SCOPED SCRIPTS" +.PP The \fBnamespace code\fR command is the means by which a script may be packaged for evaluation in a namespace other than the one in which it was created. It is used most often to create event handlers, Tk bindings, and traces for evaluation in the global context. For instance, the following -code indicates how to direct a variable trace callback into the current +code indicates how to direct a variable \fBtrace\fR callback into the current namespace: .PP .CS @@ -708,7 +709,7 @@ namespace: puts "the value of $n1 has changed to $var" return } - trace variable b w [\fBnamespace code\fR theTraceCallback] + trace add variable b write [\fBnamespace code\fR theTraceCallback] } set a::b c .CE |