[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unary minus
Original-Via: uk.ac.nsf; Fri, 8 Mar 91 23:23:25 GMT
Date: Fri, 8 Mar 91 08:12:15 MST
From: Joe Fasel <jhf@chaco.c3.lanl.gov>
To: haskell <haskell%edu.yale.cs@yalevm.ycc.yale.edu>
Subject: Re: Unary minus
Original-Sender: jhf%gov.lanl.c3.chaco%edu.yale.ycc.yalevm%edu.yale.cs@yale.edu
Sender: haskell-request@cs.glasgow.ac.uk
| From: Andrew Appel <appel%Princeton.EDU%YALECS.BITNET@yalevm.ycc.yale.edu>
|
| It might be a good idea to follow the example of all the languages in the
| Algol family---whether they're right or wrong, at least people are used
| to writing expression that way. In those languages, I believe,
| unary minus binds very tightly.
I don't think so. At least, in Algol 60, Fortran, Pascal, and Ada,
prefix minus has the same syntactic precedence as infix minus. The
BNF is usually like this:
<adding operator> ::= + | -
<term> ::= <factor> | <adding operator> <factor>
| <term> <adding operator> <factor>
--Joe