Be gentle with me....

William Tanksley wtanksle at hawking.armored.net
Tue Dec 7 23:06:32 EST 1999


On 8 Dec 1999 00:33:41 GMT, Neel Krishnaswami wrote:
>Samuel A. Falvo II <kc5tja at garnet.armored.net> wrote:
>>In article <slrn84r667.1bb.neelk at brick.cswv.com>, Neel Krishnaswami wrote:
>>>parenthesized s-exps is why Lisp has a macro system that does not 
>>>suck -- Lisp macros are essentially transformations of the abstract 
>>>syntax. And that macro system is why even novel ideas can always be
>>>expressed cleanly in Lisp.

>>Forth has much the same capabilities without the use of parentheses.  In
>>fact, it uses zero punctuation at all.  :-)

>Does every Forth word have a fixed number of arguments? That seems
>like the only way it could work.

No, although variable-length argument lists are as hard to do in Forth as
variable-length return lists are in Lisp.  Interestingly enough, and as
you might expect, variable length returns are trivial in Forth.

>I have to admit to being a weakling in this regard though: I have
>trouble reading pre/post-fix linearizations of syntax trees and
>usually end up manually adding parens so I can figure out the
>structure.

Forth doesn't have any syntax, so there are no trees to linearize.  There
IS a stack, though; Forth is RPN.

Parens wouldn't help you.  Forth is far too expressive.  You'd have to use
a lot of highly complex lambda expressions as well in order to represent a
fairly simple forth expression via parens.

And often vice versa -- it's a different way of thinking.

>My brother claims that Forth is a language that basically did the
>opposite of Lisp at every design point (eg, no garbage collection,
>postfix syntax, close-to-the-metal rather than highly abstract, etc)
>and therefore proves by example that Lisp is not the sole right way to
>design a language. He goes on to say that he's a bit worried by the
>fact that it's the *only* counterexample he has found.... :)

That's a very amusing way to put it.  Yes, I could agree with your brother.

>Neel

-- 
-William "Billy" Tanksley, in hoc signo hack



More information about the Python-list mailing list