Re: Syntax

salomon@silver.cs.umanitoba.ca (Dan Salomon)
Wed, 4 Dec 1991 20:46:18 GMT

          From comp.compilers

Related articles
Current work in compiler/language design. hackeron@Athena.MIT.EDU (Harris L. Gilliam - MIT Project Athena) (1991-11-10)
Syntax andy@SAIL.Stanford.EDU (1991-11-27)
Re: Syntax drw@cantor.mit.edu (1991-12-03)
Re: Syntax salomon@silver.cs.umanitoba.ca (1991-12-04)
Re: Syntax rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell) (1991-12-05)
Re: Syntax buzzard@eng.umd.edu (1991-12-05)
Re: Syntax ea08+@andrew.cmu.edu (Eric A. Anderson) (1991-12-05)
Re: Syntax gaynor@remus.rutgers.edu (1991-12-05)
Re: Syntax kend@data.rain.com (1991-12-04)
| List of all articles for this month |
Newsgroups: comp.compilers
From: salomon@silver.cs.umanitoba.ca (Dan Salomon)
Keywords: syntax, Lisp
Organization: Computer Science, University of Manitoba, Winnipeg, Canada
References: 91-11-030 91-12-012
Date: Wed, 4 Dec 1991 20:46:18 GMT

In article 91-12-012 drw@cantor.mit.edu (Dale R. Worley) writes:
> In article 91-12-004 andy@SAIL.Stanford.EDU (Andy Freeman) writes:
>
> [...] the "infix" languages don't agree on
> precedence because people don't, at least for operators other than *, +,
> -, and /. (BTW - There isn't even agreement on how consecutive - and /s
> are grouped.)
>
> It's worse than that -- in Snobol 4, "-" has a lower precedence than
> "+", that is, "a + b - c + d" is parsed as "(a + b) - (c + d)".
> Similarly for "*" and "/".


These arguments are getting off the topic. The original poster said that
infix is more natural than prefix, NOT that it is more precise. Usually
arguments about the "naturalness" of programming language constructs are a
waste of time, since our understanding of human psychology is still very
superficial and subjective. In addition, with enough training almost any
language can be made to seem natural.


I must point out, however, that since we have been trained in infix
notation starting in grade one, we can only expect most programmers to
find infix notation more natural. In any case, infix is more concise than
prefix since it usually requires fewer parentheses. In addition, it is
fairly easy to show that humans are not very good at matching parentheses
beyond a about three levels.


Many programmers hate LISP, and hate it passionately. In expressing their
distaste for it they have no choice but to express it in undefendable
terms of its naturalness. This gives the LISP supporters, and there are
many, a wide open field to find flaws in the attacks.


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.