diff options
Diffstat (limited to 'contrib/tcl/doc/upvar.n')
-rw-r--r-- | contrib/tcl/doc/upvar.n | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/contrib/tcl/doc/upvar.n b/contrib/tcl/doc/upvar.n index e6e47ce..1920d37 100644 --- a/contrib/tcl/doc/upvar.n +++ b/contrib/tcl/doc/upvar.n @@ -1,11 +1,11 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. +'\" Copyright (c) 1994-1997 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" SCCS: @(#) upvar.n 1.15 96/08/26 13:00:19 +'\" SCCS: @(#) upvar.n 1.16 97/08/13 13:43:34 '\" .so man.macros .TH upvar n "" Tcl "Tcl Built-In Commands" @@ -57,6 +57,17 @@ Although \fBadd2\fR could have been implemented using \fBuplevel\fR instead of \fBupvar\fR, \fBupvar\fR makes it simpler for \fBadd2\fR to access the variable in the caller's procedure frame. .PP +\fBnamespace eval\fR is another way (besides procedure calls) +that the Tcl naming context can change. +It adds a call frame to the stack to represent the namespace context. +This means each \fBnamespace eval\fR command +counts as another call level for \fBuplevel\fR and \fBupvar\fR commands. +For example, \fBinfo level 1\fR will return a list +describing a command that is either +the outermost procedure call or the outermost \fBnamespace eval\fR command. +Also, \fBuplevel #0\fR evaluates a script +at top-level in the outermost namespace (the global namespace). +.PP .VS If an upvar variable is unset (e.g. \fBx\fR in \fBadd2\fR above), the \fBunset\fR operation affects the variable it is linked to, not the @@ -74,5 +85,8 @@ invoked). In particular, if the array is \fBenv\fR, then changes made to \fImyVar\fR will not be passed to subprocesses correctly. .VE +.SH "SEE ALSO" +namespace(n) + .SH KEYWORDS -context, frame, global, level, procedure, variable +context, frame, global, level, namespace, procedure, variable |