From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56648: 29.0.50; Need for `compiled-function-p` Date: Sun, 14 Aug 2022 22:36:04 -0400 Message-ID: References: <871quc8n90.fsf@gnus.org> <87edyayie9.fsf@gnus.org> <83ilmukby2.fsf@gnu.org> <835yiuk8ih.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23992"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56648@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 15 04:37:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oNPyc-000609-EF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Aug 2022 04:37:14 +0200 Original-Received: from localhost ([::1]:50524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNPyb-0008TJ-Bz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 22:37:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNPyQ-0008Sx-Vo for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 22:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNPyQ-0001Cx-N5 for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 22:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNPyQ-0004Fg-Id for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 22:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Aug 2022 02:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56648 X-GNU-PR-Package: emacs Original-Received: via spool by 56648-submit@debbugs.gnu.org id=B56648.166053098116294 (code B ref 56648); Mon, 15 Aug 2022 02:37:02 +0000 Original-Received: (at 56648) by debbugs.gnu.org; 15 Aug 2022 02:36:21 +0000 Original-Received: from localhost ([127.0.0.1]:40176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNPxl-0004Ek-6v for submit@debbugs.gnu.org; Sun, 14 Aug 2022 22:36:21 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNPxj-0004EX-3b for 56648@debbugs.gnu.org; Sun, 14 Aug 2022 22:36:20 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id ACC9C44133F; Sun, 14 Aug 2022 22:36:13 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7A0DF441344; Sun, 14 Aug 2022 22:36:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1660530972; bh=5CW4BS3ILg4mluiG7JoljOL3Xh9CRo/QEQ6zyEiRFXo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=T+5mT3DLNtCqzxp4WEu7+H8YvzwyEs38W+46ABu3of67DuCrobrGy8xkLbgWlaTxL aPgU+Piac4UmDtjFxSuYfQPZ2Y9g5UgjOF2fPXjyaeW2buRoqUqnig0u2BSPafuVtE ypWDGE91+xYra/NALuoiKnch6YWH4U1vT5lUza7UpzjF4nz/3lA0FyuIFBBvhE/kYl xRJBUh9zR19UGwgl7KGKQvwQhPf1FTkf/WOzVdAgag/kZylu4Eydz9xNJBvfFiUw17 D7t+isRBpJnrKlR7yZ0L4wa5n7mGA5dETpAQbOGiG4NzLEI0vPunljLm+hmr/RlVtN Zw9BtaVadrk+w== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2BA221204A2; Sun, 14 Aug 2022 22:36:12 -0400 (EDT) In-Reply-To: <835yiuk8ih.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 14 Aug 2022 21:03:18 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:239717 Archived-At: >> >> - (or (byte-code-function-p (symbol-function 'byte-compile-form)) >> >> - (subr-native-elisp-p (symbol-function 'byte-compile-form)) >> >> - (assq 'byte-code (symbol-function 'byte-compile-form)) <<<<<<<<<<<<< >> >> + (or (compiled-function-p (symbol-function 'byte-compile-form)) >> >> According to my reading of the code, this `assq` can never return >> non-nil. > > Too bad the commit log message didn't say that, then. Imagine someone > 5 or 10 years from now trying to understand the fine points of that > changeset... If (assq 'byte-code (symbol-function 'byte-compile-form)) returns non-nil, it means that the `byte-compile-form` function has been byte-compiled by the Emacs-18 byte-compiler (the byte-code-function type was only introduced in Emacs-19). So `compiled-function-p` *should* replace all 3 cases. IOW I believe the above diff is "obviously right" and the question is whether `compiled-function-p` should be changed to return non-nil for functions of the form (lambda (...) (byte-code ...)), i.e. those functions generated by Emacs-18's byte-compiler. I hope we don't need to keep that backward compatibility, tho ;-) Stefan