Re: Syntax, expressiveness and the beauty of Tcl
- From: Stephan Kuhagen <nospam@xxxxxxxxxx>
- Date: Tue, 31 Oct 2006 06:35:04 +0100
Christian Gollwitzer wrote:
I also dislike expr in Tcl, if one has to do lots of math. Especially
that in 99% cases one needs to use additional braces.
Uh oh, what have I done...
Set is OK. I'd
like to have a syntax like
${something}
as an equivalent to [expr {something}]
So one could write
set a ${$b+7}
to get this more compact. However, this not possible in Tcl withou
changing the language...
It should be easier, if the $ is replaced with something else. $ also looks
always as a variable reference to me. Yours would then be to set "a" to the
value of the variable "$b+7", at least that is how it looks to.
But maybe, there is indeed some need to have the possibility to do some more
math expressions "on the fly" inside other statements. I think, nobody
wants something like the {expand}-thing to expand math expressions in the
line, but some simple and short way to have this in the middle of other
statements seems to be useful to me. But I have no idea, how to put this
into the language, without changing it too much (that is without violating
the "command args"-scheme).
Stephan
.
- References:
- Syntax, expressiveness and the beauty of Tcl
- From: Stephan Kuhagen
- Re: Syntax, expressiveness and the beauty of Tcl
- From: Christian Gollwitzer
- Syntax, expressiveness and the beauty of Tcl
- Prev by Date: Re: Dr. Dobb's Tcl-URL! - weekly Tcl news and links (Oct 31)
- Next by Date: Re: Syntax, expressiveness and the beauty of Tcl
- Previous by thread: Re: Syntax, expressiveness and the beauty of Tcl
- Next by thread: Re: Syntax, expressiveness and the beauty of Tcl
- Index(es):