Re: About Tcl syntax...



{=}{$a + $b} is the best because it follows the route taken by {*} so
you can add it to the non standard standard. it also jump to the eye
as mathematical.
for example:

set b {=}{[lindex $var 2]+3}    is clear

while

set b ${[lindex $var 2]+3}     is not that obvious

and

set b [{[lindex $var 2] +3}]    is confusing.

and

set b [expr {[lindex $var 2] +3}]    is traditional :-)-

I thought "[{$a + $b}]" may be simpler to implement (though maybe
not!!).

The "${$a + $b}" format has the (possible) advantage that "$
{sonemthing}" already has a meaning and could possibly be adapted?

I think things like...

set c ${$a + $b}

...and...

command -parm1 ${$value + 1} -parm2 ${$myvar * 12}

...and...

set myvar ${[lindex $var 2] + 3}

...are quite readable. Again, it depends how many existing scripts
will break.

Personally I dont like...

{=}{$a + $b}

...as I think it clearer when the whole "thing" is enclosed in a
single pair of braces/brackets.

Best Regards,
=Adrian=
.