beetlebug▾
/

info locals

Gives the names of the local variables of the running proc.

info locals ?PATTERN?

Description

Gives the name of each local variable of the running proc, with its arguments. A variable that global, upvar, or variable links into the proc is not in the list. At the global scope the list is empty. With PATTERN, the list has only the names that match it as a glob pattern.

Arguments

ArgumentTypeDefaultDescription
PATTERNglob patternnoneThe names to keep.

Returns

A list of variable names.

Examples

% proc f {x} {set y 1; info locals}; f 1
x y

% proc f {} {global gv; set loc 1; info locals}; f
loc

% info locals

Errors

% info locals a b
wrong # args: should be "info locals ?pattern?"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also