Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!europa.eng.gtefsd.com!howland.reston.ans.net!EU.net!uunet!newsflash.concordia.ca!CC.UMontreal.CA!IRO.UMontreal.CA!saguenay.iro.umontreal.ca!guerin
From: guerin@IRO.UMontreal.CA (Frederic Guerin)
Subject: Re: Prefix vs. Infix?
Message-ID: <CyMJ75.K2D@IRO.UMontreal.CA>
Sender: news@IRO.UMontreal.CA
Organization: Universite de Montreal
X-Newsreader: TIN [version 1.2 PL2]
References: <37jo4v$7lm@hobbes.cc.uga.edu> <CyI3Bq.75F@IRO.UMontreal.CA> <393vkc$8op@uqcspe.cs.uq.oz.au>
Date: Wed, 2 Nov 1994 04:59:28 GMT
Lines: 55

: >form 1 :	assign ( a , + ( 2 , 3 ) )	use 11 tokens
: >form 2 :	( assign a ( + 2 3 ) )		use 9 tokens
: >form 3 :	a := 2 + 3			use 5 tokens

: WRONG
:  form 3 :	a := 2 + 3 ;			use 6 tokens

well, you're right, I forgot the ';' at the end of form 1 and 3.

:   Foo(Bar(X Y + 3) - Q Z - T) 

: is quite hard to read.  Moving the parentheses out is orthogonal to
: this problem, eg.

: (Foo (Bar X, Y + 3) - Q, Z - T);

: is a strange mixture of the two that does not help.

what about (Foo (Bar X Y+3)-Q Z-T) ? 

: So the problem with infix is that you need to delimit the expressions,
: even if they contain only one factor.  However, I have a strong
: suspicion that there is some middle way.  One nasty approach is to use
: "{}" (say) to introduce infix, thus

: (Foo {Bar(X, Y + 3) - Q} (ff (gg h i) k)).

clearly nasty ! :-)

: But there must be a clean way of utilizing operator precedence of well
: known operators, which is fairly elegant.

: >If you intend to use a lot of the same
: >funcionality, then infix is for you. Number crunching language has better
: >go this way. If you intend to do a lot of symbolic computation, then
: >prefix notation is for you. 

: Fair enough, if there is no middle way.  But we do not want two types
: of grammars in the same language!

Your last statement is a very true fact, some digressions are permitted,
but full-prefix + full-infix seems too much to fit in one language.  

: The real point, however, is that non Lisp programmers unbiased by
: experience or careful analysis *KNOW* that parenthesis are
: unacceptable, and IMHO this is a major reason that Lisp died.  Syntax
: is always more important than semantics.

well, this is the content-container dilemna, a beautiful container to
attract, and a good content to keep. 

: Anthony

Frederic

