Re: Syntax, expressiveness and the beauty of Tcl
- From: mghembru@xxxxxxxxxxxxxxxxxxxx (MH)
- Date: Tue, 31 Oct 2006 00:05:55 +0000 (UTC)
In article <454690AA.5080109@xxxxxxx>, Kevin Kenny <kennykb@xxxxxxx> wrote:
Eckhard Lehmann wrote:
That all looks very weird and complex. What about a simple and strict
polish notation, like in LISP:
proc + {a b} {expr {$a + $b}}
proc - {a b} {expr {$a - $b}}
proc * {a b} {expr {$a * $b}}
proc / {a b} {expr {$a / $b}}
set res [+ [* 7 8] [- 8 9]]
55
Every operator is a command as well and it is compatible with the rest
of Tcl (although it will be even less familiar to the majority of
programmers)
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..
<sigh>
MH
.
- Follow-Ups:
- Re: Syntax, expressiveness and the beauty of Tcl
- From: Stephan Kuhagen
- Re: Syntax, expressiveness and the beauty of Tcl
- References:
- Syntax, expressiveness and the beauty of Tcl
- From: Stephan Kuhagen
- Re: Syntax, expressiveness and the beauty of Tcl
- From: Christian Gollwitzer
- Re: Syntax, expressiveness and the beauty of Tcl
- From: Eckhard Lehmann
- Re: Syntax, expressiveness and the beauty of Tcl
- From: Kevin Kenny
- Syntax, expressiveness and the beauty of Tcl
- Prev by Date: Re: Syntax, expressiveness and the beauty of Tcl
- Next by Date: Re: Tcl/Tk Books updated for 8.5
- Previous by thread: Re: Syntax, expressiveness and the beauty of Tcl
- Next by thread: Re: Syntax, expressiveness and the beauty of Tcl
- Index(es):
Relevant Pages
|