Re: Syntax, expressiveness and the beauty of Tcl
- From: Fredderic <put_my_name_here@xxxxxxxxxxxxxxx>
- Date: Tue, 31 Oct 2006 22:06:53 +1000
On Mon, 30 Oct 2006 15:33:52 +0100,
Christian Gollwitzer <Christian.Gollwitzer@xxxxxxxxxxxxxxx> 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. 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}
Question... Any reason it couldn't be adapted to a syntax like:
set a ${{$b+7}}
ala bash shells in *nix? The ${{...}} structure doesn't do what it
looks like it'd do anyhow. One would incorrectly assume that it would
either resolve a variable whos name contains the inner brackets, or
that the inner brackets would be magically absorbed as some kind of
list-of-a-single-word thing. In actual fact, the first open-brace
matches the first close-brace, with the effect that the second
open-brace is considered part of the variable name, and the second
close-brace is literal. This would be a very ugly variable name to try
and work with at the best of times.
So adding support for ${{...}} being equivalent to [expr {...}], might
actually make the syntax cleaner and slightly less confusing than it
already is anyhow, by giving it an actual defined meaning.
Fredderic
.
- Follow-Ups:
- Re: Syntax, expressiveness and the beauty of Tcl
- From: suchenwi
- Re: Syntax, expressiveness and the beauty of Tcl
- 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: Syntax, expressiveness and the beauty of Tcl
- 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):
Relevant Pages
|