[Nickle] sort of a bug

Ireland Peddlar nickle@nickle.org
Fri, 14 Feb 2003 20:46:26 +0000


When Bart was looking at what I was doing and noticed this, he said it 
shouldn't be this way and post a bug report.  You might want to talk to him 
about it, he knows more than I do about what is going on.
Erin



----Original Message Follows----
From: Keith Packard <keithp@keithp.com>
Reply-To: nickle@nickle.org
To: nickle@nickle.org
CC: Keith Packard <keithp@keithp.com>
Subject: Re: [Nickle] sort of a bug
Date: Fri, 14 Feb 2003 12:02:45 -0800
MIME-Version: 1.0
Received: from home.keithp.com ([63.227.221.253]) by 
mc8-f40.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Fri, 14 Feb 
2003 12:03:04 -0800
Received: from localhost ([127.0.0.1] helo=home.keithp.com)by 
home.keithp.com with esmtp (Exim 3.36 #1 (Debian))id 18jm34-0006nU-00; Fri, 
14 Feb 2003 12:03:02 -0800
Received: from evo.keithp.com ([10.0.0.6] helo=localhost)by home.keithp.com 
with esmtp (Exim 3.36 #1 (Debian))id 18jm2n-0006n7-00for 
<nickle@nickle.org>; Fri, 14 Feb 2003 12:02:45 -0800
Received: from localhost ([127.0.0.1] helo=keithp.com)by localhost with 
esmtp (Exim 3.36 #1 (Debian))id 18jm2n-0001Hc-00; Fri, 14 Feb 2003 12:02:45 
-0800
X-Message-Info: dHZMQeBBv44lPE7o4B5bAg==
X-Mailer: exmh version 2.3.1 11/28/2001 with nmh-1.0.4+dev
In-reply-to: Your message of "Fri, 14 Feb 2003 19:30:09 GMT."             
<F41gC4Z9ep7KSEoTT2w00005e14@hotmail.com>
Message-Id: <E18jm2n-0001Hc-00@localhost>
Sender: nickle-admin@nickle.org
Errors-To: nickle-admin@nickle.org
X-BeenThere: nickle@nickle.org
X-Mailman-Version: 2.0.13
Precedence: bulk
List-Help: <mailto:nickle-request@nickle.org?subject=help>
List-Post: <mailto:nickle@nickle.org>
List-Subscribe: 
<http://nickle.org/mailman/listinfo/nickle>,<mailto:nickle-request@nickle.org?subject=subscribe>
List-Id: Nickle language list <nickle.nickle.org>
List-Unsubscribe: 
<http://nickle.org/mailman/listinfo/nickle>,<mailto:nickle-request@nickle.org?subject=unsubscribe>
List-Archive: <http://nickle.org/pipermail/nickle/>
Return-Path: nickle-admin@nickle.org
X-OriginalArrivalTime: 14 Feb 2003 20:03:05.0108 (UTC) 
FILETIME=[16059D40:01C2D464]


Around 19 o'clock on Feb 14, "Ireland Peddlar" wrote:

 > Factorial is binding tighter than the preinrement operator.
 > ++x! is parsed as ++(x!) and dies.

Hmm.  C has a single level of precedence for unary operators and groups
them from right to left.  You'll get the same error from the C compiler
with:

	int foo (int x) { return --x++; }

Because of the right to left binding, any postfix unary operators with the
are effectively given higher precedence than prefix unary operators with
the same specified precedence.

There's a problem here though; the grammar does operator precedence based
on the operator tokens in the input stream.  So, I can't change the
precedence of the factorial operator without also changing the precedence
of the boolean negation opertor as they share the same token.

I think that means we're stuck with this precedence inversion; I don't
want to gratuitously differ from C in such a subtle way.

-keith



_______________________________________________
Nickle mailing list
Nickle@nickle.org
http://nickle.org/mailman/listinfo/nickle


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus