Re: Syntax, expressiveness and the beauty of Tcl



MH wrote:

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.

I guess I understand WHY CP was a natural method (since one can define the
operators to be the equivalent of a proc), but..

As a VERY frequent unix "dc" user (started with my HP-28S), I probably use
RPN more (to find answers, as opposed to entering formulae in programs)
than infix..

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. 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. Of
course, the TIP puts them in a new namespace, but do you really want to
import math operators into the current namespace or reference them with
full namespace path? I don't think so... Then I like the good old [expr]
much better, which can be easily extended to understand some new operators,
expressions or even syntax (maybe something [expr -p + 2 3] to say [expr]
to use prefix operators?). But I like my other idea better, to extend
[expr] such that it can assign its results to a variable using [expr
x=...]. This would be a very small change, that does not introduce a big
change into the language, but saves many of the annoying examples from the
other postings here.

Regards
Stephan

.