The uplevel
command executes a command (or actually a script) in a different scope than in the current procedure. In particular, in this case it is uplevel 1
, which means "execute in the caller". (You can also execute in the global scope using uplevel #0
or in other places, such as the caller with uplevel 2
, but this is very rare.)
Explanation of the rest of this line: using list
here is a way to build a command without replacement, which consists of four words, foreach
, the contents of the variable args
, the contents of the variable valueList
and break
(in fact, this should not have been in braces). This will assign a value from the front of the valueList
each variable specified in args
and then stop, and this will be done in the context of the caller.
In general, this procedure works just like the built-in lassign
in 8.5 (assuming a non-empty input list and a list of variables), except for a slower one due to the complexity of exchanging between areas and such things.
source share