tcl - what is the different use of " " and {} -


when want implement own procedure have 1 doubt. example, following ok:

% proc + {a b} {expr $a+$b} % + 3 4 7 

but when using "" instead of {}:

% proc + "a b" "expr $a+$b" 

it give error:

can't read "a": no such variable 

at same time when use \ gives answer:

% proc + "a b" "expr \$a+\$b" 

here, \ not considered $ special char take $a , same second example. can tell me difference between these 3 methods of defining proc?

the fundamental difference between quotes , curly braces variables expanded inside of quotes, not in curly braces. in final example, when place backslash in front of dollar sign, removes special nature of dollar sign, variable isn't expanded.

this explained on tcl man page. single page remarkably concise , accurate description of language.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -