vset Tcl Command

NAME

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

SYNOPSIS

dmh::vset 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:

vset "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.

Prior to Tcl version 8.4, this command was provided with the Hume DMH package with the name lset. The command has been renamed to avoid conflicts with the new core command.

AUTHOR

Ed Hume, Hume Integration Software

SEE ALSO

foreachlindexrset

KEYWORDS

list, vset, rset