chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Fix cond behaviour of => with constant conditi


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Fix cond behaviour of => with constant condition [Was: Re: [Chicken-users] Unbound => in cond statements]
Date: Fri, 17 Oct 2014 20:48:08 +0200
User-agent: Mutt/1.4.2.3i

On Fri, Oct 17, 2014 at 07:44:27PM +0200, Michele La Monaca wrote:
> Hi,
> 
> curiously:
> 
> 
> (cond (1 => odd?))
> 
> Error: unbound variable: =>
> 
> while
> 
> 
> (cond (+ => procedure?))
> #t
> 
> The only difference I can spot is that 1 is self-evaluating while + is
> not. Anyhow, it doesn't look good to me.

Well-spotted!  This was due to an optimisation which rewrote
(cond (CONSTANT <whatever> ...) ...) to <whatever>, which is correct,
but it forgot to rewrite (cond (CONSTANT => <whatever>) ...) to
(<whatever> CONSTANT).

The attached patch fixes it.

Thanks for reporting this issue!

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Fix-incorrect-optimization-in-cond-expansion.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]