Re: Syntax, expressiveness and the beauty of Tcl



Eckhard Lehmann wrote:

Stephan Kuhagen wrote:
I wasn't aware of this, but I think, I do not like it. It is a question
of what you are used to, of course. But in source-code I prefer writing
infix instead of prefix operators.

The point is, that it resembles the Tcl way better and is easier to
explain.

True. But I think it is very unusual for many people. Maybe both should be
possible in [expr].

In LISP, everything is prefix, so the (+ a b) is no surprise.
Tcl is similar regarding prefix operators. [expr] is the prefix
operator for math but inside it mixes infix notation in - which differs
from the philosophy of prefix operators that you have everywhere else
in Tcl.

Hm, yes, that's true but... it feels uncomfortable. I think [expr] always as
a kind of sub-language in Tcl. So I would prefer [expr]s sub-language to
use infix (at least to stay backward-compatible), but maybe there could be
a switch to [expr] to change the parser so prefix.

Stephan
.



Relevant Pages

  • Re: Syntax, expressiveness and the beauty of Tcl
    ... But I am not against prefix operators, ... a hook to them. ... will be prefix "operators" in Tcl 8.5 (really Tcl commands that do ... mathematical operations and whose names look like [expr] operators). ...
    (comp.lang.tcl)
  • Re: Syntax, expressiveness and the beauty of Tcl
    ... Tcl is similar regarding prefix operators. ... operator for math but inside it mixes infix notation in - which differs ... I think [expr] always as ...
    (comp.lang.tcl)
  • Re: Syntax, expressiveness and the beauty of Tcl
    ... But I am not against prefix operators, ... Enough votes are now in on TIP#174 that we can say for sure that there ... will be prefix "operators" in Tcl 8.5 (really Tcl commands that do ... mathematical operations and whose names look like [expr] operators). ...
    (comp.lang.tcl)