emacs-devel
[Top][All Lists]
Advanced

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

Re: master f9d7440: ; * lisp/emacs-lisp/byte-opt.el (byte-optimize-eq):


From: Pip Cet
Subject: Re: master f9d7440: ; * lisp/emacs-lisp/byte-opt.el (byte-optimize-eq): Fix last change.
Date: Tue, 20 Jul 2021 20:07:43 +0000

On Tue, Jul 20, 2021 at 5:32 PM Mattias Engdegård
<mattiase@savannah.gnu.org> wrote:
> diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
> index 7ed04b3..c9c0ac0 100644
> --- a/lisp/emacs-lisp/byte-opt.el
> +++ b/lisp/emacs-lisp/byte-opt.el
> @@ -970,10 +970,9 @@ See Info node `(elisp) Integer Basics'."
>       form)))
>
>  (defun byte-optimize-eq (form)
> -  (byte-optimize-binary-predicate
> -   (pcase (cdr form)
> -     ((or `(,x nil) `(nil ,x)) `(not ,x))
> -     (_ form))))
> +  (pcase (cdr form)
> +    ((or `(,x nil) `(nil ,x)) `(not ,x))
> +    (_ (byte-optimize-binary-predicate form))))

I played around with simple expressions a little after this patch, and
things didn't seem quite right. The good news is they weren't quite
right without the patch, either.

I find things work better with the attached patch applied. If it is as
obviously correct as it seems to me, it should probably be applied.

But it does occur to me this code optimizes (quote) to nil. Is that
intentional? Is it worth fixing? (It also optimizes (quote 1 2 3) to
1).

Pip

Attachment: 0001-Fix-test-in-byte-optimize-quote.patch
Description: Text Data


reply via email to

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