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!news.sprintlink.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: <CyI3Bq.75F@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>
Date: Sun, 30 Oct 1994 19:26:12 GMT
Lines: 28

stone (stone@phoenix.cs.uga.edu) wrote:
: Other than the obvious, what's the difference?  Is there any reason I
: should use one vs. the other?  (Does prefix compile faster, etc?)


The difference, to me, is the following, given the example :

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

So here is the trade-off :
You may exchange a more simple syntax ( form 2 : prefix language ) to a
more complex one ( form 3 : infix language ) which uses less lexical units
and hence may happen to be easier to read by an accustomed reader.
Accustomed here is *very important*, and you can't introduce an operator
for each new functionality introduced or else the code will be unreadable
( assuming multiple precedence infix notation ). In those cases, you must
resort to a non ambiguous notation ( form 1 ), which is less effective
than prefix notation ( form 2 ). 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. 

yours,

Frederic Guerin 

