From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel 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 Message-ID: References: <20210720173248.5699.35348@vcs0.savannah.gnu.org> <20210720173249.D00AF209AA@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000008202d805c7939d7a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32576"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org, =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 20 22:14:07 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5w7y-0008Ev-Gb for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Jul 2021 22:14:06 +0200 Original-Received: from localhost ([::1]:37194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5w7x-00073c-AN for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Jul 2021 16:14:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5w2R-0006uC-Ep for emacs-devel@gnu.org; Tue, 20 Jul 2021 16:08:26 -0400 Original-Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:42790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5w2P-0008JZ-PW for emacs-devel@gnu.org; Tue, 20 Jul 2021 16:08:23 -0400 Original-Received: by mail-oi1-x236.google.com with SMTP id e11so457494oii.9 for ; Tue, 20 Jul 2021 13:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=EW1PvMTlqEvuNM3Y+ORIplta8Hgf5vAZdcyCl4oXy0c=; b=CauDJme8hZ2VVF9fzlrqqqooqM/BOkHgew0UT9Qh9mxLyzznmPADF5fyNCk/R9H4wO fuKSABV4l3gA5eycaN6hMCSRxOGo29OpkArSqNUw+JHEDuKlOf8wRjP7wlSFy+TCEXeF Nvq/SHqhRVxOYOk5JWDjrRuq7glzOUDKa19aXFMMFE6oXOpo0gdRsiNVI4w9bLTInIRb idV5gYzhMnqZAiBrKSbsC2kSULggNcw4607DJolAhjbVeVVfQ3I9Rdj7g4MOYvvwCPi6 VIlh0Y2hX36SRBammqMAOhnzY7To452weFQQs8P6Uxol3Hsq+WcseVFb4DinxKN8c2bS 69vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=EW1PvMTlqEvuNM3Y+ORIplta8Hgf5vAZdcyCl4oXy0c=; b=fDSzy6QL0m23GMqzdceYaQYYSyJWCuec+bTK5bRfXSEMwpWiPZTG6mPP01c0+6jSte xz5CX9r9xkXes8874AXW6eRHo9XAGGSNHtDQV0FpRjzgt1avTFFeKEzGCO8tjWjtK7A9 REzTux7zTC6EYDZvOg4F/zuCuo8zzjP56anr7S5xlDFm4B/HrvxG/0tyoXZCp4zlIdzo wnKIdnIvJ5rEkzx3HsVqdCAHM7HBKnkfjncQsUcvEMkbGQc1qiO0MPd43p65UG5cTcfv GWBPBXHLmM6Hs00SeaKeUvkldwQZBsgHlIyi7W45IC3sKVA5+Bz7Z2Za40KVcAMCf0c2 UiQw== X-Gm-Message-State: AOAM530bCpQH70M2dRFuZIgiDq1Pi5L8iHcW72pHPJ0xLvDVC8WnlP9Y sBzkxRAOvSUcqc/JPDjUelLau+ocd6QgDijJIOGV4YExiLWazg== X-Google-Smtp-Source: ABdhPJzalxXG7h2/LJEMU8t5SeMp/zKgnmagirFySetPiXIxGq3r3w//FseIbFPKXTOy7dWF5NMlVPqnVTKlPCJD9Tw= X-Received: by 2002:aca:c78d:: with SMTP id x135mr139227oif.30.1626811700208; Tue, 20 Jul 2021 13:08:20 -0700 (PDT) In-Reply-To: <20210720173249.D00AF209AA@vcs0.savannah.gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=pipcet@gmail.com; helo=mail-oi1-x236.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271390 Archived-At: --0000000000008202d805c7939d7a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 20, 2021 at 5:32 PM Mattias Engdeg=C3=A5rd 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 --0000000000008202d805c7939d7a Content-Type: text/x-diff; charset="US-ASCII"; name="0001-Fix-test-in-byte-optimize-quote.patch" Content-Disposition: attachment; filename="0001-Fix-test-in-byte-optimize-quote.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_krchkz1o0 RnJvbSBlMzE3NjQ3MDc0NjJiYTI3ODU0OWFhY2U3MWI2OTllZjA0MTI3Y2QyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaXAgQ2V0IDxwaXBjZXRAZ21haWwuY29tPgpEYXRlOiBUdWUs IDIwIEp1bCAyMDIxIDE5OjU4OjE2ICswMDAwClN1YmplY3Q6IFtQQVRDSF0gRml4IHRlc3QgaW4g Ynl0ZS1vcHRpbWl6ZS1xdW90ZQoKKiAgKGJ5dGUtb3B0aW1pemUtcXVvdGUpOiBGaXggY29uZGl0 aW9uIG5vdCB0byBiZSB0cml2aWFsbHkgZmFsc2UuCi0tLQogbGlzcC9lbWFjcy1saXNwL2J5dGUt b3B0LmVsIHwgMiArLQogMSBmaWxlIGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspLCAxIGRlbGV0aW9u KC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9lbWFjcy1saXNwL2J5dGUtb3B0LmVsIGIvbGlzcC9lbWFj cy1saXN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