Re: Syntax, expressiveness and the beauty of Tcl




Kevin Kenny

TIP #174 (http://tip.tcl.tk/174) is being voted on this week.
It provides exactly the Cambridge Polish (not RPN, the "reverse"
in RPN indicates that the operator comes *last*) notation that
you request.

Sorry for the "reverse".. I meant strict prefix notation of operators
;-).

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. 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.

I also dislike it, because it introduces so
many new commands and will not stop to extend (and floating the namespace)
with new commands until all possible math expressions are included.

There are more math operators expressed in prefix notation anyway:
[sin], [cos], [tan] [abs], [round]... Why not be consistent?


Eckhard

.



Relevant Pages

  • Re: Any macro for inserting math "normally"
    ... relevant common language with its notation takes precedence. ... | states that prefix does not work for large chunks of math. ... | syntax odd for math and he want infix math for Arc (next ...
    (comp.lang.lisp)
  • Re: merits of Lisp vs Python
    ... With prefix or postfix notation, you need to parse the full ... I would say that prefix/postfix is somewhat easier to write, but that infix ... The advantages from infix notation becomes from readability not from ... in CanonML you can define higher-level syntaxes using ...
    (comp.lang.lisp)
  • Re: Why is LISP syntax superior?
    ... mathematical notation, when it is really related to the own LISP ... have some kind of prefix-based syntax for handling declarations, ... once you have a language defined entirely by this prefix ...
    (comp.lang.lisp)
  • Re: Any macro for inserting math "normally"
    ... relevant common language with its notation takes precedence. ... | states that prefix does not work for large chunks of math. ... | syntax odd for math and he want infix math for Arc (next ...
    (comp.lang.lisp)
  • Re: Why is LISP syntax superior?
    ... notation for the over command in pure LISP. ... It seems that one will really need to have a great aversion to prefix ... discuss more about posibilities for without explicit markup ...
    (comp.lang.lisp)