Re: Syntax, expressiveness and the beauty of Tcl
- From: "Eckhard Lehmann" <ecky-l@xxxxxx>
- Date: 30 Oct 2006 09:17:07 -0800
Christian Gollwitzer wrote:
[...]set x [expr $a+$b]
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
set a ${$b+7}
That all looks very weird and complex. What about a simple and strict
polish notation, like in LISP:
proc + {a b} {expr {$a + $b}}
proc - {a b} {expr {$a - $b}}
proc * {a b} {expr {$a * $b}}
proc / {a b} {expr {$a / $b}}
set res [+ [* 7 8] [- 8 9]]
55
Every operator is a command as well and it is compatible with the rest
of Tcl (although it will be even less familiar to the majority of
programmers)
Eckhard
.
- Follow-Ups:
- Re: Syntax, expressiveness and the beauty of Tcl
- From: Stephan Kuhagen
- Re: Syntax, expressiveness and the beauty of Tcl
- From: Kevin Kenny
- Re: Syntax, expressiveness and the beauty of Tcl
- From: Uwe Klein
- 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: time calculation
- Next by Date: Re: strings in 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
|
|