Re: About Tcl syntax...
- From: Adrian Davis <adrian@xxxxxxxxxxxx>
- Date: Wed, 2 Jul 2008 03:53:42 -0700 (PDT)
{=}{$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=
.
- Follow-Ups:
- Re: About Tcl syntax...
- From: miguel
- Re: About Tcl syntax...
- References:
- Re: About Tcl syntax...
- From: Adrian Davis
- Re: About Tcl syntax...
- From: miguel
- Re: About Tcl syntax...
- From: Adrian Davis
- Re: About Tcl syntax...
- From: miguel
- Re: About Tcl syntax...
- From: Adrian Davis
- Re: About Tcl syntax...
- From: Donal K. Fellows
- Re: About Tcl syntax...
- From: Adrian Davis
- Re: About Tcl syntax...
- From: miguel
- Re: About Tcl syntax...
- From: neuronstorm@xxxxxxxxx
- Re: About Tcl syntax...
- From: Adrian Davis
- Re: About Tcl syntax...
- From: yahalom
- Re: About Tcl syntax...
- Prev by Date: Re: Devanagari question
- Next by Date: Re: About Tcl syntax...
- Previous by thread: Re: About Tcl syntax...
- Next by thread: Re: About Tcl syntax...
- Index(es):