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

Re: SYNTAX ONLY - Precedence of prefix minus



Original-Via: uk.ac.ukc; Thu, 14 Mar 91 06:55:21 GMT
From: lex@prles6.prl.philips.nl
Date: Thu, 14 Mar 91 07:41:30 +0100
To: haskell@cs.glasgow.ac.uk
Subject: Re: SYNTAX ONLY - Precedence of prefix minus
Cc: lex@prles6.UUCP
Original-Sender: lex%nl.philips.prl.prles6@hp4nl.nluug.nl
Sender: haskell-request@cs.glasgow.ac.uk

In the current and heated debate about the precedence of the
prefix minus operator,
it was suggested that -2^2 should be equivalent to 0-2^2, which
would be parsed as (0-2)^2. It was further suggested that the 'mathematical
interpretation' of -x whould alsways be 0-x.

May I conclude from this, that the mathematical interpreation of
2*-3 is 2*0-3, which will be parsed as (2*0)-3?
Hopefully not.

It was further suggested that the problem could be solved by giving
prefix minus the same precedence as infix minus.

Does this mean that 2*-3*4 should be parsed as 2*(-(3*4)), rather than
as 2*(-3)*4? I know that there is no semantical difference between these
expression, but that is not the issue here.

I hope some mathematician can enlight me here.

     Lex Augusteijn.