Tcl/Tk Documentation > TclCmd > global : "info locals" issue
- From: Werner Wenzel <wgwenzel@xxxxxxxxxxx>
- Date: Thu, 28 Aug 2008 22:18:01 +0200
The official Tcl documentation (8.5.4) reads:
global varname ?varname ...?
DESCRIPTION
This command has no effect unless executed in the context of a proc body. If the global command is executed in the context of a proc body, it creates local variables linked to the corresponding global variables
*** (and therefore these variables are listed by info locals). ***
But:
set x 3
proc test {} {
global x
set y 7
puts "x = $x, y = $y"
info locals
}
"test" yields:
x = 3, y = 7
y
saying that x is locally visible but *not* listed by "info locals".
What am I not understanding?
Werner
.
- Follow-Ups:
- Re: Tcl/Tk Documentation > TclCmd > global : "info locals" issue
- From: Don Porter
- Re: Tcl/Tk Documentation > TclCmd > global : "info locals" issue
- Prev by Date: Re: TclX loop slow in the default case
- Next by Date: Re: Tcl/Tk Documentation > TclCmd > global : "info locals" issue
- Previous by thread: Re: Tcl 2008 abstracts online
- Next by thread: Re: Tcl/Tk Documentation > TclCmd > global : "info locals" issue
- Index(es):
Relevant Pages
|