- $varname ~~ [set varname]
set abc "123"
set xyz $abcorset xyz [set abc]
- [script] ~~ [eval {script}]
- "string" ~~ [subst string]
- "$list1 $list2 ..." ~~ [concat $list1 $list2 ...]
set colors {taupe puce heliotrope}
set countries {Djibouti Brazil Azerbaijan}
set var "$colors $countries"
set var [concat $colors $countries]Example:
set var "1 2 3"
set var {1 2 3}
set var [list 1 2 3]Example:
set abc $::env(HOME)or
global env
upvar #0 env env2
set abc $env(HOME)
set abc2 $env2(HOME)escargo 7/7/7 - Are you looking for examples how these are not equivalent? CMcC I changed it to 'approximates.'For example, I seem to recall that [eval] does a round of substitution before evaluating its input. (Logically, it would seem to be necessary for [] !~ [eval], otherwise eval is just taking up space.)And subst takes arguments that allow limitations on the substitutions.LV I think what is being sought are cases where there is more than one way to do it, as the Perl community says. This could be cases of Tcl syntactical sugar (notational shortcut approximates).
