|
From: avl <av...@lo...> - 2017-02-15 08:36:16
|
Donald Arseneau <asnd@tr...> wrote:
> Multi assignments within expr... All this discussion on unusual
> variable names and how to quote them.
> Doesn't anyone else think the proposed feature is hideous?!?!
Can't speak for "anyone else", but I consider it an improvement
over status quo, even already at this stage. Discussion may still
lead to a state of bigger improvement.
> That's what other languages have been stamping out with compiler
> warnings!
As if other languages (apart from original bourne shell) had such
a visual clutter for performing e.g. a simple multiplication in the
first place...
The point is not just turning [set x [expr {$x*2}]] to [expr {x=$x*2}]
but to be able to use one "expr" for multiple calculations.
e.g.: expr { "len" = sqrt($x*$x+$y*$y); "xn" = $x/$len; "yn" = $y/$len }
or maybe: expr { len := sqrt($x*$x+$y*$y); xn := $x/$len; yn := $y/$len }
And it is only about how tcl code looks like, because resulting bytecode
should be the same as with a series of single set-expr groups.
But thanks for sharing your stance.
|