[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Left hand sides and priorities.



Date: Thu, 7 Mar 91 10:07:12 EST
From: johnsson
To: haskell@cs.glasgow.ac.uk
CC: kent@se.chalmers.cs
In-reply-to: Kent Karlsson's message of Wed, 6 Mar 91 18:29:11 +0100 <9103061729.AA16146@birk.cs.chalmers.se>
Subject: Re: Left hand sides and priorities.



I absolutely agree with Kent's complaints, both about left hand
sides, and proirities of - and ^.

I think that left hand sides should be like "and extended subset" of
expressions, i.e. where some expressinos are obviously disallowed
as patterns, e.g., if then else, where etc, while others are particular 
to patterns, e.g. ~ and @ .

[ As an aside, one way to get a smaller parser, e.g. smaller
LR tables, would then be to take the union of expressions and
patterns, parse an equation as
           <expr-union-pat> [ | <guard> ] = <expr-union-pat>
or, even regard | and = as operators with the lowest priorities
and simply parse an equation as 
           <expression>  .
Some post-processing would of course have to be done.
end aside.]

>  Another priority issue, why is  -2^2  equal to  4  while  0-2^2  is  -4 ?

Again I agree with Kent, my gut reaction is that -2^2 is equal to -4.

-- Thomas