Tcl/Tk Documentation > TclCmd > global : "info locals" issue



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
.



Relevant Pages