Re: Syntax, expressiveness and the beauty of Tcl



Larry Smith wrote:

Stephan Kuhagen wrote:
2+2 -> x

As far as I know, this came from POP-11.

I never heard about that. What is it? Or do you mean PDP-11?

I've never seen it elsewhere.

"->" is one character on the Casio pocket calculator, if I remember right.
If you're interested, it was this one:

http://rechner.hs.abcbtx.de/Gall_Casio/index.php?i=132

with it's manual here:

http://www.casiotechno.com/download/manual/FX-8000G.pdf

Mine still does work, and wow, I had 1917 kind of Bytes for storing my
programs! (Kind of because every token was one "Byte"... strange)

And, as I've noted before, it's a good fit with Tcl syntax _iff_ you
use "->" as a synonym for ";" with the proviso that the scanner will
generate the appropriate "set" after scanning ahead to eol or the next
";" to pick up the variable name. That is, the above is simply
understood by the scanner to be shorthand for "set x [ expr 2+2 ]",
the same way it now understands $x is shorthand for [ set x ].

But this would be a bigger change to the scanner? Looks to me, if this
likely would have very bad performance.

Regards
Stephan
.