Re: Syntax, expressiveness and the beauty of Tcl



Stephan Kuhagen wrote:
Maybe, this extension should be really part of [expr], so we can write
expr {x=some_expr}
instead of
set x [expr {some_expr}]

That's TIP#282, which is probably not going to be in 8.5 after all. That
is because it introduces a new concept, an LValue, which [expr]essions
didn't have before, and we'd like to have more alpha-cycle time to
evaluate it's effects.

You can hack your way around this by defining a [set] function, perhaps
like this:
interp alias {} ::tcl::mathfunc::set {} ::set
which you would then use like this:
expr { set("x", 1+2+3) }

Donal.
.