lset Tcl Command

NAME

lset - assign a list of values to a list of names

SYNOPSIS

lset values names

DESCRIPTION

Each variable named in the list names, is given the corresponding value in the list values. If there are more names than values, the extra names are assigned the value of an empty string. The command is an efficient and understandable alternative to scanning a list repeatedly using lindex to parse its elements. For example:

lset "green black pink" "foreground background highlight"
puts "the background color is $background"

The command is a functional subset of the rset command. The latter command is able to recurse nested lists, and parse arbitrarily complex data structures.

AUTHOR

Ed Hume, Hume Integration Software

SEE ALSO

rset

KEYWORDS

list, lset, rset