tcl: prepend a list of strings using lmap
<p>I have the following input: {x y z} and need the output to be {$x $y $z}
It is straightforward to do this using <code>append</code> and <code>foreach</code></p>

<pre><code>set args {x y z}
#---------------------------------
# using append
#---------------------------------
set result {}
foreach i $args {
    append result " \$[set i]"
}
puts $result ;# $x $y $z
</code></pre>

<p>But when I tried to use <code>lmap</code>, I get the following error 'unknown command '$x'`
I tried the usual quoting tricks but it did not work. </p>

<pre><code>#---------------------------------
# using lmap
#---------------------------------
# results in  
# unknown command '$x'
lmap i $args { \$[set i] }
</code></pre>