Re: Syntax

kend@data.rain.com (Ken Dickey)Wed, 4 Dec 91 11:56:42 PST

From comp.compilers

Related articles
[2 earlier articles]
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: kend@data.rain.com (Ken Dickey) Followup-To: comp.lang.misc Keywords: syntax, design Organization: Compilers Central References: 91-11-030 91-12-004 Date: Wed, 4 Dec 91 11:56:42 PST

>In article 91-11-081 objsys@netcom.com (Bob Hathaway) writes:
>>Natural syntax : if a plus b times c equals zero ...
>>Typical syntax : if a + b * c == 0 then ...
>>Unnatural syntax : (if (== (+ a (* b d)) 0 ) ... )
>>
>>Unnatural means that for this trivial last example I first drew the tree
...

I would have expected:

natural->typical-C would be: if (((a + b) * c) == 0) { ... }
natural->lispish: (if (zero? (* (+ a b) c)) ... )

My own ordering:

Natural syntax: X is in range low..high, inclusive
Typical syntax: (<= low X high)
Unnatural syntax: ((low <= X) && (X <= high))

Unnatural means to me that the last example has too many parenthesis.
8^)

-Ken Dickey kend@data.rain.com
[This is about all the "my language is more unnatural than yours" than I
can take -- followups elsewhere, please. -John]
--

Post a followup to this message