Subject: Re: bug#411: 23.0.60; flet and byte-compilation

From: Chong Yidong <[email-masked]>
Date: Wed, 24 Sep 2008 22:16:07 -0400

Glenn Morris <[email-masked]> wrote:

> > (defun f (x y)
> >   (flet ((+ (a b) (- a b)))
> >     (+ x y)))
> > 
> > Bytecompile it [...]
> > 
> > Evaluate the expression (f 1 2). This should yield -1, but the result
> > will be 3.
>
> it works to comment out the line in bytecomp.el
>
> (byte-defop-compiler (+ byte-plus)  byte-compile-associative)
>
> I guess byte-compile-associative mangles the '(+ x y) form without
> regard for the redefinition in effect. I don't know if that is
> fixable, or should be a documented caveat with regards to primitives.

I don't see how to fix this, and my inclination is to just document this
limitation in the docstring of `flet'.  Stefan, WDYT?