Path: utzoo!attcan!uunet!zephyr.ens.tek.com!tekcrl!tekgvs!toma From: toma@tekgvs.LABS.TEK.COM (Tom Almy) Newsgroups: comp.lang.misc Subject: Re: Anyone want to design a language? Message-ID: <6925@tekgvs.LABS.TEK.COM> Date: 22 Feb 90 17:57:42 GMT References: <22569:05:10:24@stealth.acf.nyu.edu> <8475@wpi.wpi.edu> <111355@ti-csl.csc.ti.com> <447@fwi.uva.nl> <10979@saturn.ADS.COM> <111706@ti-csl.csc.ti.com> Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 37 In article <111706@ti-csl.csc.ti.com> gateley@m2.csc.ti.com (John Gateley) writes: >So, why is postfix better than prefix? >One other poster mentioned postfix, and made the claim that it >was better than prefix as well, and I am curious why >y'all think so. (i'd take postfix over infix any day, but prefer >prefix because I am used to it). Most postfix fanatics (typically Forth programmers, of which I am one) will say postfix is better than prefix (thinking of LISP) because it eliminates the need for all of those parenthesis. In fact, parenthesis (as grouping operators) are only needed if you don't know how many arguments are needed for a function. You can get rid of most parenthesis in a prefix language, for instance LOGO behaves much like a parenthesis-free LISP. The only real advantage of postfix is that it can be directly executed in a stack architecture. What bothers me is not so much pre vs. in vs. post but what I call mixfix. Mixfix is a hodgepodge of pre/in/post fix notation that can be very confusing. At least LISP is consistantly prefix (LOGO isn't). Some offenders: Back in the days of the calculator wars, there was HP touting postfix while TI touted algebraic (which I would consider to be infix diadic functions and prefix monadic functions eg 4 + sin(-x) ). Yet HP wasn't fully postfix -- the register access functions (sto and rcl) were prefix. And TI's monadic functions were really postfix eg 4 + (x - sin) ). Forth, the "king of postfix" uses prefix functions for string arguments. C is a hodgepodge of pre/post/in fix. eg ++ is either pre or post, * is either pre or in, [] is post. In an integer constant 0 and 0x are pre and L is post. Tom Almy toma@tekgvs.labs.tek.com Standard Disclaimers Apply