From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jul 2023 12:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 64646@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168942302213190 (code B ref -1); Sat, 15 Jul 2023 12:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Jul 2023 12:10:22 +0000 Received: from localhost ([127.0.0.1]:44315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKe6Q-0003Qf-A1 for submit@debbugs.gnu.org; Sat, 15 Jul 2023 08:10:22 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKe6N-0003QQ-US for submit@debbugs.gnu.org; Sat, 15 Jul 2023 08:10:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKe6I-0002tA-DB for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 08:10:14 -0400 Received: from mx3.muc.de ([193.149.48.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKe6G-0006Es-AF for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 08:10:14 -0400 Received: (qmail 16277 invoked by uid 3782); 15 Jul 2023 14:10:07 +0200 Received: from acm.muc.de (pd953a5ce.dip0.t-ipconnect.de [217.83.165.206]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 15 Jul 2023 14:10:06 +0200 Received: (qmail 18875 invoked by uid 1000); 15 Jul 2023 12:10:06 -0000 Date: Sat, 15 Jul 2023 12:10:06 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) In the master branch: (i) emacs -Q (ii) C-x b foo.el (iii) Insert into foo.el: ;; -*- lexical-binding:t -*- (iv) M-x emacs-lisp-mode (v) Insert into foo.el: (defun foo () "foo doc string" (lambda (bar) "lambda doc string" (car bar))) (vi) With point after the function, C-x C-e to evaluate it. (vii) M-: (native-compile 'foo) This returns # (viii) M-: (foo) This returns the lambda form as a byte-compiled function. This is a bug: it should return the lambda form as a native-compiled function. Note: this bug is also in the emacs-29 branch. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jul 2023 13:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie , Andrea Corallo Cc: 64646@debbugs.gnu.org Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.168942636619025 (code B ref 64646); Sat, 15 Jul 2023 13:07:01 +0000 Received: (at 64646) by debbugs.gnu.org; 15 Jul 2023 13:06:06 +0000 Received: from localhost ([127.0.0.1]:44355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKeyL-0004wm-Td for submit@debbugs.gnu.org; Sat, 15 Jul 2023 09:06:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKeyJ-0004wJ-Pt for 64646@debbugs.gnu.org; Sat, 15 Jul 2023 09:06:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKeyD-0005h9-Ig; Sat, 15 Jul 2023 09:05:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=4kSxwstRgLax0ZlM8ZIYWI6FZSccqeoJxTV6uXST0WA=; b=pEYn7I06wgGF Kvkvrd6ABKygUCEvupc7Zn314NRzFx0Lapt5Q+HbysRIbkSa1rA/p4IlUKqjwBFEZuYUsYqPUHVnX ILhbuWwPDlrRLhGAE6YSQiRn1+h2cfOSBMBOBha0gAIfa7w/f7gZuvlz+Ve50VfhSxk75zzdQGLJ1 Uvc/darGutLA1WotBXoLkSaQi3HTf51Rk+RYNWlvKySYJoqhAZOM5NX7qf5+F9w9ONHa9fTL9JhrN opmBM3l6yf2xZA11q89+ehYz6PskxRP0DBCYpKtcrRDaq0Y7mYNxnfzmqXxqj3fHRbfrGqySsNyW9 E9o0cqd25+W7xjDsqX5TJQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKeyD-00019V-0V; Sat, 15 Jul 2023 09:05:57 -0400 Date: Sat, 15 Jul 2023 16:06:18 +0300 Message-Id: <83wmz1b9yt.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Alan Mackenzie on Sat, 15 Jul 2023 12:10:06 +0000) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 15 Jul 2023 12:10:06 +0000 > From: Alan Mackenzie > > In the master branch: > > (i) emacs -Q > (ii) C-x b foo.el > (iii) Insert into foo.el: > ;; -*- lexical-binding:t -*- > (iv) M-x emacs-lisp-mode > (v) Insert into foo.el: > (defun foo () "foo doc string" > (lambda (bar) "lambda doc string" (car bar))) > (vi) With point after the function, C-x C-e to evaluate it. > > (vii) M-: (native-compile 'foo) > This returns # > (viii) M-: (foo) > This returns the lambda form as a byte-compiled function. This is a bug: > it should return the lambda form as a native-compiled function. Why do you think it should return the native-compiled form? Based on what? From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jul 2023 13:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 64646@debbugs.gnu.org, Andrea Corallo Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.168942721620415 (code B ref 64646); Sat, 15 Jul 2023 13:21:02 +0000 Received: (at 64646) by debbugs.gnu.org; 15 Jul 2023 13:20:16 +0000 Received: from localhost ([127.0.0.1]:44359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKfC4-0005JD-Cx for submit@debbugs.gnu.org; Sat, 15 Jul 2023 09:20:16 -0400 Received: from mx3.muc.de ([193.149.48.5]:40126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKfBz-0005Iq-Lb for 64646@debbugs.gnu.org; Sat, 15 Jul 2023 09:20:15 -0400 Received: (qmail 99200 invoked by uid 3782); 15 Jul 2023 15:20:05 +0200 Received: from acm.muc.de (pd953a5ce.dip0.t-ipconnect.de [217.83.165.206]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 15 Jul 2023 15:20:04 +0200 Received: (qmail 20950 invoked by uid 1000); 15 Jul 2023 13:20:04 -0000 Date: Sat, 15 Jul 2023 13:20:04 +0000 Message-ID: References: <83wmz1b9yt.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83wmz1b9yt.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sat, Jul 15, 2023 at 16:06:18 +0300, Eli Zaretskii wrote: > > Date: Sat, 15 Jul 2023 12:10:06 +0000 > > From: Alan Mackenzie > > In the master branch: > > (i) emacs -Q > > (ii) C-x b foo.el > > (iii) Insert into foo.el: > > ;; -*- lexical-binding:t -*- > > (iv) M-x emacs-lisp-mode > > (v) Insert into foo.el: > > (defun foo () "foo doc string" > > (lambda (bar) "lambda doc string" (car bar))) > > (vi) With point after the function, C-x C-e to evaluate it. > > (vii) M-: (native-compile 'foo) > > This returns # > > (viii) M-: (foo) > > This returns the lambda form as a byte-compiled function. This is a bug: > > it should return the lambda form as a native-compiled function. > Why do you think it should return the native-compiled form? Based on > what? Well, if the native compilation compiled _all_ of the defun, the lambda form would also have been compiled, and surely that is what should have been returned. There is some suspicion that the native compilation on this defun is incomplete. When we do byte-compilation, the returned value is byte-compiled. By analogy, when we do NC, the return value should be NC'd. I can't see any reason to return a byte-compiled function. The fact that we use byte-compilation as a part of native-compilation should be an internal detail, not visible from outside. Also, the returned lambda function being byte-compiled will cause it to run more slowly that if it were native-compiled. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jul 2023 04:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 64646@debbugs.gnu.org Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.16894809874217 (code B ref 64646); Sun, 16 Jul 2023 04:17:01 +0000 Received: (at 64646) by debbugs.gnu.org; 16 Jul 2023 04:16:27 +0000 Received: from localhost ([127.0.0.1]:46339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKtBK-00015w-Ob for submit@debbugs.gnu.org; Sun, 16 Jul 2023 00:16:27 -0400 Received: from mout.web.de ([212.227.17.12]:54803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKtBG-00015h-Pw for 64646@debbugs.gnu.org; Sun, 16 Jul 2023 00:16:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1689480974; x=1690085774; i=michael_heerdegen@web.de; bh=2CnpO61UsUx2v83FSz25CzVZDXJPUyKXW07m9LrNuW4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=qzW8hNabC1sQaYlh8tZpL4ajhlSdGw5o4RtHemgD7qS5KYzYwuLBwpC0ZxRpwn6pgeAs97r CPcATcjVI4MFwRWCzcrBthcrxUUtcTroL4wtnEMy8R7f3p8ko/tVmV4weScZRXXSJdGEjvNoW sTUU1GuSjTB9AWzbd40o3h1dQTWsRT/0iPDTmaqJL358yu8dw7fGF9wMBD2qywewRMhcbgN68 7Qb0gAljSK/qU6pzn/YSWxFGi76qOe9MCXhEVFMUvhhGEjklmdy+Y7fIMtom72eP26UQ1bd8v TLNPKNRb585Cxxwn446ActXDmdd/UyX87DX5PPa29zCMdSMpgSPg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.59.210.36]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Mpl0p-1pbckF1Ywn-00pzPp; Sun, 16 Jul 2023 06:16:14 +0200 From: Michael Heerdegen In-Reply-To: (Alan Mackenzie's message of "Sat, 15 Jul 2023 12:10:06 +0000") References: Date: Sun, 16 Jul 2023 06:16:13 +0200 Message-ID: <87cz0swkxe.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:ZrUx3HtVGBZUf8ieieCz2U+WQH+s0+N06kVLPlOon+JU9wKq7Lv IiPw07Anm59n4lF/3dnXCNjCzy3Din9Iu7JBKuJipDhJxlhwO8wYWgv7zebMxkwg75M5eLq VY4HtNaryJamQh0LRmrhdJ22aQY0X26GInoPjTNDQ3QlQNrk8PAhS5OEn2PuwgugVlZ31P7 mlvEOUfx5R5TAHLn73PYw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:J5mD9Fs62tE=;Ls0LcvG00LLc7Wpbh4lpPf5M+fw hIxyoE2uDloyuCq+4iN6kRwMmfb0MDKT9AlCtQqZ+XCke+Mwib5pUvJbhoyw3AEoyzXm3e4Fl kQ/rLMe9h/77dL8ZdEVX+u3dsGW84MSq0cZNfGCSs7jsHUH0eFcYqWvrCq6cvuY/BUwIDZAVH JzIkmcexYLYp4M6Q5m2cfV3x9QY1fA3cAvuCQLx+3JFzU25oA5A/69LuEVrtBSVoVzdHp2c9m Ayq/0Ml2V2/dSGVVA81ASkBgi8Kw8NXtRQwxGvxGJx9+XikLMAHDBeNFAmdMuhexTTNeuD9kN VDLPdCW4rMZoharuY23jYvbT+Kgik9xJHGX9ZGKvyeUZEJPhkA1ucc0k9eQUJQwm0AKRgQNbB hpx6ZlGAFRAaH9Acryy3qzWFEoojVdA6FAggVhiihgy7P5LGhZP0Ucu7mRw/xnoDs4usGIqpU y4Z5/mlaZoxqq2uTehMaQ8yYfjGWujObjKj9362vSSqAntvv54X3eVYouoYTZGKe5qISTl9kn A3MMNmvzXHSCxb3b/pplVA3xkQxm8defl1ofKKJRpmwF7Q32oqv4XVmEguy1JbTRV41Wq2owa xzYq5ojOKMgF0cmuZk4YpC6hqlUz29+BQX3k4Yj2oLQzTs2Zjhe1iSVHAgXIdWJBRZnTr2iP7 IyNosydiOw/yjCpFm6cNCUjuVfUDRZG9ae41KTlN0iNgPSf7w2581aq54K+5hgkMrbfU6Sk6C f4lpUGVX2Nt6USoEd9nFwo9uGHYgcRLxifmS4Lp+PemvRucbj4MN1/HBWN2tKSMmYonhZfYfL VQGb8ovrxK22uHKUmDpkNRcCOu9THeUnf3OY/QRuBmoNQv1v3XuI2mSc1oTg/82BVtnLcoQO3 X29wP2N0eid90vMqX6QznF02wcp7dQewXk07/olquEk9UQ6r3+32WFjh2BDJ/WqxbWa9etJbE Rgr2G9jcbf/dd7WUL4W91ldaqLE= X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > (vii) M-: (native-compile 'foo) > This returns # > (viii) M-: (foo) I apologize when this is a dumb question, but: is this call using the native-compiled function? Michael. From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jul 2023 09:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Heerdegen Cc: 64646@debbugs.gnu.org Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.16894980804717 (code B ref 64646); Sun, 16 Jul 2023 09:02:02 +0000 Received: (at 64646) by debbugs.gnu.org; 16 Jul 2023 09:01:20 +0000 Received: from localhost ([127.0.0.1]:46810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKxd2-0001E1-4u for submit@debbugs.gnu.org; Sun, 16 Jul 2023 05:01:20 -0400 Received: from mx3.muc.de ([193.149.48.5]:18744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKxcy-0001Dg-8Z for 64646@debbugs.gnu.org; Sun, 16 Jul 2023 05:01:18 -0400 Received: (qmail 12043 invoked by uid 3782); 16 Jul 2023 11:01:09 +0200 Received: from acm.muc.de (pd953aa9c.dip0.t-ipconnect.de [217.83.170.156]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 16 Jul 2023 11:01:09 +0200 Received: (qmail 3149 invoked by uid 1000); 16 Jul 2023 09:01:08 -0000 Date: Sun, 16 Jul 2023 09:01:08 +0000 Message-ID: References: <87cz0swkxe.fsf@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87cz0swkxe.fsf@web.de> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Michael. On Sun, Jul 16, 2023 at 06:16:13 +0200, Michael Heerdegen wrote: > Alan Mackenzie writes: > > (vii) M-: (native-compile 'foo) > > This returns # > > (viii) M-: (foo) > I apologize when this is a dumb question, but: is this call using the > native-compiled function? It's not at all a dumb question, it's very pertinent. After step (vii), M-: (symbol-function 'foo) returns # .. So I think the call in (viii) is indeed using the native-compiled function. > Michael. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jul 2023 02:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 64646@debbugs.gnu.org Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.168955931114740 (code B ref 64646); Mon, 17 Jul 2023 02:02:01 +0000 Received: (at 64646) by debbugs.gnu.org; 17 Jul 2023 02:01:51 +0000 Received: from localhost ([127.0.0.1]:48770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLDYc-0003pg-OY for submit@debbugs.gnu.org; Sun, 16 Jul 2023 22:01:51 -0400 Received: from mout.web.de ([212.227.17.12]:60311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLDYY-0003pO-74 for 64646@debbugs.gnu.org; Sun, 16 Jul 2023 22:01:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1689559298; x=1690164098; i=michael_heerdegen@web.de; bh=hJlR8zue9YUWoIUO/Wg/vTAKJgUN1Ss3duyk40n53Zo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=lhcVzkz1cK/tBiRIXHPumm7TFRK0Y4cy4Hf1QlrDCnNhw3bfL/MNISjrPNhNRGSoffTeuFd +x3Mda66vJrHJmWjDtRccGlpIDz3sOyIYgajDAwt34j1Ty43IIHQUn+ZuUiOjxodD5Okfo2h9 NlO04p8vHQO7zIhVME00jJq7UtXls8JUH+jcjL7OUH2sgnOFVg2SnrpOwWjD2fPSp0TQ883qj zWPvEOE34zJsQLyzyre2aeZjS6nUvTgKrORi19tRvecL5+JlwwaG92iISUedmazVEi0Qa8kAW RAemlUlezJTi4JZwzmk0ESayyoOBmR4n4DgcE8BllVfyeMgq7fuA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.59.210.36]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M7ux6-1qHO4W0exe-0059DP; Mon, 17 Jul 2023 04:01:38 +0200 From: Michael Heerdegen In-Reply-To: (Alan Mackenzie's message of "Sun, 16 Jul 2023 09:01:08 +0000") References: <87cz0swkxe.fsf@web.de> Date: Mon, 17 Jul 2023 04:01:37 +0200 Message-ID: <87mszvthxa.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:X3MYoy/TqGQKW6SYv+sT2RZ3380gtL2SsJUVE5l+nGjduT4S2mH w8pDsqxtcCKgWpo6I7v9SRw2QbLZTy7Sj0Q9a54Pb8K4r28NtbkpNGQRbUa4kXL0qvapMwL 6CXtMjwdLs+4838sLbm2PcqOrDg2oh/pYPPWzqKZqYdk4p5cGVC27qw9bLSykKgDORjYn1Y mEhto7PhdeGqutP3u8Mgw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:BykOYX6yXiE=;9lY548RXatTk7cEh3wIAAjitYaX LwsU+qHPmMxlbexUsLoSL4SVFThoO96QKCWkWU+qcnW0fu7bViDnBYsuoCsVasgRyJX1mNqJE sQeerh/RjMLZAduxOdrOFsBD1Uq5iDmS6x1z3duJCVnqmTgcFBTmdWQxMR5ouOPokmaiZMace M1oEBCkQz8QkkuAPs/DXe6KG15WRfVbEX8Pojy9EuRwBM+YWJnNV3WiLYxg8US0LYUK+jd65H j06LsXoq8jjKokDI1RVd1aTzNXDC4qjWMXLhrml5pVfKx+7MRHG4Pww0pqKDptY41guc+Xjf1 Xn0eHSceMwaVpTVmcti6wHD1CrKy3kT+EE/rHu0ZU0qR4WlPs0yiDC/M3zNW61flWkzj5aHOq X1WEC2TP3P8iEVZjaf/ua3lkea4ZY9ya5B6mjjmnmiZsp9J7dXvsJkaJiDqCQvhDV+HaSUoqm /PjlzvS4LPv3b6Kkq/WS6Ue1rVUMFv1UHeIowiLNChDVKNFhYvlaII8dA9VKIJsX7KcWlTSbz EJLGRJ8VhOK17CYgeiOzBY5pAoWcdftwfRNgVC/aguBjm/7g4mBmuOSu0qOxb8F5JMbTuqYDI xAbsZY3sPx8LJRkhbPhOJlDT89AlNM3v+AOaPN0GBpitp8gbxxz5Ze36dEKc5x8GVb65CLZR+ MxIafz8PrKguHNgAT5qPIQ/6wa0mvQgomLauDvpy37I7TW2drEOmVVNBmXTbAgM8VehFcYhtD fuJEK378+cMkfsVNHT+IrBXma/L/j5y3rxISIiNGjHKIXS/g6gOoRIbkoWeT/kdtbfNROWGxA dikvIumnYAJmItDbcxjWESTmONdVQYgULNtr8WmfKI903GsKCQ778kfzw9y8NpFsKyOE2VDOW ntfatqV3eabgR2cwbVHVfOJBCiXLZYavCKN1E16bFN3vHBIYq+hGaEJyOMVUDCzFVc4vgk0NX fpLRov/A1xiuiDEgoMEf4aBT/bI= X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > After step (vii), M-: (symbol-function 'foo) returns > > # > > .. So I think the call in (viii) is indeed using the native-compiled > function. Thanks. Yes, then I would also expect it to return the created function as a native-compiled function object. Michael. From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jul 2023 13:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 64646@debbugs.gnu.org Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.168959984319548 (code B ref 64646); Mon, 17 Jul 2023 13:18:01 +0000 Received: (at 64646) by debbugs.gnu.org; 17 Jul 2023 13:17:23 +0000 Received: from localhost ([127.0.0.1]:49436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLO6N-00055D-Dx for submit@debbugs.gnu.org; Mon, 17 Jul 2023 09:17:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLO6L-000550-4C for 64646@debbugs.gnu.org; Mon, 17 Jul 2023 09:17:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLO6F-0000mO-3H; Mon, 17 Jul 2023 09:17:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=qjSXiaM+NXD6nDn1vlrnAEocj0LoEgz7zhOaasVKLd4=; b=Lc2OUlk7huMIOoGI1Bwc nZG6GfzWDzb/dfA/LlHyDXweNJdn83VP9beJ6ikSvgt7qi1NsDkCDNCkAtFuTQebKREt4wEW5SOxp n4Yika2aQYItufD8LOiR84guqoowcIeJ7+iN2LhiswJUECb0/vmioHDtPL0sVXvcLbQSh9kI0+Re5 /kRW8l7uHIOV7YLTqZWuNB0mEHkjnrCfgc6iVRLFm5swM6KuQnFiEqsgRyak1wS4OwoFuulH/9lgZ cKdVkKtXFDFxCxLKk6K0hyEsPMoighLbdPRGmmWQQ3zLanIPuTYbWRdKHPDB4tlJvbP3pHQ+8G+CV 4zI9pFX8kUtFBw==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qLO6D-0003Ix-U6; Mon, 17 Jul 2023 09:17:14 -0400 From: Andrea Corallo In-Reply-To: (Alan Mackenzie's message of "Sat, 15 Jul 2023 12:10:06 +0000") References: Date: Mon, 17 Jul 2023 09:17:13 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alan Mackenzie writes: > In the master branch: > > (i) emacs -Q > (ii) C-x b foo.el > (iii) Insert into foo.el: > ;; -*- lexical-binding:t -*- > (iv) M-x emacs-lisp-mode > (v) Insert into foo.el: > (defun foo () "foo doc string" > (lambda (bar) "lambda doc string" (car bar))) > (vi) With point after the function, C-x C-e to evaluate it. > > (vii) M-: (native-compile 'foo) > This returns # > (viii) M-: (foo) > This returns the lambda form as a byte-compiled function. This is a bug: > it should return the lambda form as a native-compiled function. > > Note: this bug is also in the emacs-29 branch. Hi Alan, I can reproduce, (native-compile 'foo) compiles only foo, compiling the whole compilation unit with eg `emacs-lisp-native-compile-and-load' compiles as expected also the inner lambda. I'm not 100% convinced this behaviour is a bug tho. Andrea From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Jul 2023 12:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrea Corallo Cc: 64646@debbugs.gnu.org Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.168985528329274 (code B ref 64646); Thu, 20 Jul 2023 12:15:02 +0000 Received: (at 64646) by debbugs.gnu.org; 20 Jul 2023 12:14:43 +0000 Received: from localhost ([127.0.0.1]:57899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMSYM-0007c4-Ay for submit@debbugs.gnu.org; Thu, 20 Jul 2023 08:14:43 -0400 Received: from mx3.muc.de ([193.149.48.5]:55171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMSYI-0007bg-J6 for 64646@debbugs.gnu.org; Thu, 20 Jul 2023 08:14:41 -0400 Received: (qmail 85797 invoked by uid 3782); 20 Jul 2023 14:14:32 +0200 Received: from acm.muc.de (p4fe15497.dip0.t-ipconnect.de [79.225.84.151]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 20 Jul 2023 14:14:32 +0200 Received: (qmail 6774 invoked by uid 1000); 20 Jul 2023 12:14:31 -0000 Date: Thu, 20 Jul 2023 12:14:31 +0000 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Andrea. On Mon, Jul 17, 2023 at 09:17:13 -0400, Andrea Corallo wrote: > Alan Mackenzie writes: > > In the master branch: > > (i) emacs -Q > > (ii) C-x b foo.el > > (iii) Insert into foo.el: > > ;; -*- lexical-binding:t -*- > > (iv) M-x emacs-lisp-mode > > (v) Insert into foo.el: > > (defun foo () "foo doc string" > > (lambda (bar) "lambda doc string" (car bar))) > > (vi) With point after the function, C-x C-e to evaluate it. > > (vii) M-: (native-compile 'foo) > > This returns # > > (viii) M-: (foo) > > This returns the lambda form as a byte-compiled function. This is a bug: > > it should return the lambda form as a native-compiled function. > > Note: this bug is also in the emacs-29 branch. > Hi Alan, > I can reproduce, (native-compile 'foo) compiles only foo, compiling the > whole compilation unit with eg `emacs-lisp-native-compile-and-load' > compiles as expected also the inner lambda. Why would compiling a .el file compile inner lambda forms, but native-compile doesn't? > I'm not 100% convinced this behaviour is a bug tho. I don't understand that. Why might it be incorrect to compile that inner lambda natively? > Andrea -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jul 2023 14:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 64646@debbugs.gnu.org Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.169038344811246 (code B ref 64646); Wed, 26 Jul 2023 14:58:01 +0000 Received: (at 64646) by debbugs.gnu.org; 26 Jul 2023 14:57:28 +0000 Received: from localhost ([127.0.0.1]:49818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qOfxA-0002vK-1d for submit@debbugs.gnu.org; Wed, 26 Jul 2023 10:57:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qOfx7-0002v0-TL for 64646@debbugs.gnu.org; Wed, 26 Jul 2023 10:57:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qOfx2-0002WJ-7v; Wed, 26 Jul 2023 10:57:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=a32SVjWFP4Dd9eD0P92NscHJkHmBpa4nY+pm9kOB5Ho=; b=qnmbhFQCUYMbjoEgBzQa YY0FtGLLPTUWe6WDjlbdGL+evRwHgAYgQvkdmmgu9k/LrZUrZajnHTho5GDjO901wXWrR13qzQXV4 sUMvddPn18zEwbtcP55i+GCiIt50HpIQeu7yPsueMOWrdPgLNQ++oDPrTfFzKLqOPpKWpDGlT7OaK VOAHj2FPmIHa72fudbhx9FqeLDhx08hsHOPCupUHpJnPBJBVgnr2agUncNn/Vj5tDGPqVXd9Ugc2/ Od2Ll0xrGgftmg2Ffvkc4uSyzyg/UdCfGLcB8B4iu+BbH/bCJY5mUVQDMZOWp2usCMYbhuLamGlaf 3yduruecz4D4Lg==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qOfwm-0001zp-1S; Wed, 26 Jul 2023 10:57:19 -0400 From: Andrea Corallo In-Reply-To: (Alan Mackenzie's message of "Thu, 20 Jul 2023 12:14:31 +0000") References: Date: Wed, 26 Jul 2023 10:57:01 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alan Mackenzie writes: > Hello, Andrea. > > On Mon, Jul 17, 2023 at 09:17:13 -0400, Andrea Corallo wrote: >> Alan Mackenzie writes: > >> > In the master branch: > >> > (i) emacs -Q >> > (ii) C-x b foo.el >> > (iii) Insert into foo.el: >> > ;; -*- lexical-binding:t -*- >> > (iv) M-x emacs-lisp-mode >> > (v) Insert into foo.el: >> > (defun foo () "foo doc string" >> > (lambda (bar) "lambda doc string" (car bar))) >> > (vi) With point after the function, C-x C-e to evaluate it. > >> > (vii) M-: (native-compile 'foo) >> > This returns # >> > (viii) M-: (foo) >> > This returns the lambda form as a byte-compiled function. This is a bug: >> > it should return the lambda form as a native-compiled function. > >> > Note: this bug is also in the emacs-29 branch. > >> Hi Alan, > >> I can reproduce, (native-compile 'foo) compiles only foo, compiling the >> whole compilation unit with eg `emacs-lisp-native-compile-and-load' >> compiles as expected also the inner lambda. > > Why would compiling a .el file compile inner lambda forms, but > native-compile doesn't? > >> I'm not 100% convinced this behaviour is a bug tho. > > I don't understand that. Why might it be incorrect to compile that inner > lambda natively? Hi Alan, I'm not saying it would be incorrect. I'm suggesting that if is not specified what's the expected behaviour of compiling by name the outer lambda it might not be a bug. When we compile a whole compilation unit we indeed have to compile all functions, in this case what we promised is I think not defined. Andrea From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Oct 2023 13:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrea Corallo Cc: 64646@debbugs.gnu.org, acm@muc.de Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.16985857119378 (code B ref 64646); Sun, 29 Oct 2023 13:22:02 +0000 Received: (at 64646) by debbugs.gnu.org; 29 Oct 2023 13:21:51 +0000 Received: from localhost ([127.0.0.1]:40722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qx5ji-0002RC-HU for submit@debbugs.gnu.org; Sun, 29 Oct 2023 09:21:50 -0400 Received: from mail.muc.de ([193.149.48.3]:35930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qx5je-0002Qu-HY for 64646@debbugs.gnu.org; Sun, 29 Oct 2023 09:21:48 -0400 Received: (qmail 87582 invoked by uid 3782); 29 Oct 2023 14:21:07 +0100 Received: from acm.muc.de (p4fe15a23.dip0.t-ipconnect.de [79.225.90.35]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 29 Oct 2023 14:21:06 +0100 Received: (qmail 4909 invoked by uid 1000); 29 Oct 2023 13:21:02 -0000 Date: Sun, 29 Oct 2023 13:21:02 +0000 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Andrea. This bug doesn't seem to be moving, so .... On Wed, Jul 26, 2023 at 10:57:01 -0400, Andrea Corallo wrote: > Alan Mackenzie writes: > > Hello, Andrea. > > On Mon, Jul 17, 2023 at 09:17:13 -0400, Andrea Corallo wrote: > >> Alan Mackenzie writes: > >> > In the master branch: > >> > (i) emacs -Q > >> > (ii) C-x b foo.el > >> > (iii) Insert into foo.el: > >> > ;; -*- lexical-binding:t -*- > >> > (iv) M-x emacs-lisp-mode > >> > (v) Insert into foo.el: > >> > (defun foo () "foo doc string" > >> > (lambda (bar) "lambda doc string" (car bar))) > >> > (vi) With point after the function, C-x C-e to evaluate it. > >> > (vii) M-: (native-compile 'foo) > >> > This returns # > >> > (viii) M-: (foo) > >> > This returns the lambda form as a byte-compiled function. This is a bug: > >> > it should return the lambda form as a native-compiled function. > >> > Note: this bug is also in the emacs-29 branch. > >> Hi Alan, > >> I can reproduce, (native-compile 'foo) compiles only foo, compiling the > >> whole compilation unit with eg `emacs-lisp-native-compile-and-load' > >> compiles as expected also the inner lambda. > > Why would compiling a .el file compile inner lambda forms, but > > native-compile doesn't? > >> I'm not 100% convinced this behaviour is a bug tho. > > I don't understand that. Why might it be incorrect to compile that inner > > lambda natively? > Hi Alan, > I'm not saying it would be incorrect. I'm suggesting that if is not > specified what's the expected behaviour of compiling by name the outer > lambda it might not be a bug. > When we compile a whole compilation unit we indeed have to compile all > functions, in this case what we promised is I think not defined. I still don't understand that. The doc string for native-compile says: Compile FUNCTION-OR-FILE into native code. .. I can't see any reason not also to compile inner lambda functions natively. Anyhow, to fix this bug (if such it be) is easy: diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 181e5ca96a1..2360fbaa494 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1359,7 +1359,12 @@ comp-add-func-to-ctxt (comp-ctxt-top-level-forms comp-ctxt) (list (make-byte-to-native-func-def :name function-name :c-name c-name))) - (comp-add-func-to-ctxt func)))) + (comp-add-func-to-ctxt func)) + ;; Handle any lambda functions in BYTE-CODE. + (maphash (lambda (key val) + (unless (eq key (aref byte-code 1)) + (comp-intern-func-in-ctxt key val))) + byte-to-native-lambdas-h))) (cl-defmethod comp-spill-lap-function ((form list)) "Byte-compile FORM, spilling data from the byte compiler." What do you say? Incidentally, the code in the various comp-spill-lap-function methods together with comp-intern-func-in-ctxt appears to have some code duplication. Would it be possible to have the symbol and list methods of comp-spill-lap-function simply call comp-intern-func-in-ctxt the way the string method does? That would simplify those two methods quite a bit. > Andrea -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Nov 2023 17:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 64646@debbugs.gnu.org Received: via spool by 64646-submit@debbugs.gnu.org id=B64646.16989463977449 (code B ref 64646); Thu, 02 Nov 2023 17:34:02 +0000 Received: (at 64646) by debbugs.gnu.org; 2 Nov 2023 17:33:17 +0000 Received: from localhost ([127.0.0.1]:55978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qybZA-0001w1-SD for submit@debbugs.gnu.org; Thu, 02 Nov 2023 13:33:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qybZ5-0001vl-Q8 for 64646@debbugs.gnu.org; Thu, 02 Nov 2023 13:33:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qybYO-0000Jo-C3; Thu, 02 Nov 2023 13:32:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=LlgCdgliwEvz3aSfyAXYEDpUoXmDZJ8TBUsKgMAaawc=; b=jJfjiuMQZX+9i6gojXBS Xg6kChlkuS8Lzb98qiRuI+VEXVgb9lIA3ACbwE6gnHIlRyfvq7kbwTA6otE1OeqkiuLAtyvtPu8SZ RVPCaBFVS0fYUH4MwtZcjqqtNa79YQn6zamPsuqh2W8qvp/ZcvX8mg25bDBUgu8uFpeamFj8LZJHo VOuwKWRFPXX5l2qSO/i5tcyTQ+twbkNlwz1euf2bG4UZKyxH99MBy+zYdcN6OsMUe8yNOCOjG1nmc evSA9CTTXFgMfsoLqMqTYw849aW3rTGgDbz9J6d8/F5iA5RdL0Yy7zTee8PSzXJc8hbGi9Qybi+OK 7D5RilCYno13zQ==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qybYL-0004Cf-Ob; Thu, 02 Nov 2023 13:32:22 -0400 From: Andrea Corallo In-Reply-To: (Alan Mackenzie's message of "Sun, 29 Oct 2023 13:21:02 +0000") References: Date: Thu, 02 Nov 2023 13:32:21 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alan Mackenzie writes: > Hello, Andrea. > > This bug doesn't seem to be moving, so .... > > On Wed, Jul 26, 2023 at 10:57:01 -0400, Andrea Corallo wrote: >> Alan Mackenzie writes: > >> > Hello, Andrea. > >> > On Mon, Jul 17, 2023 at 09:17:13 -0400, Andrea Corallo wrote: >> >> Alan Mackenzie writes: > >> >> > In the master branch: > >> >> > (i) emacs -Q >> >> > (ii) C-x b foo.el >> >> > (iii) Insert into foo.el: >> >> > ;; -*- lexical-binding:t -*- >> >> > (iv) M-x emacs-lisp-mode >> >> > (v) Insert into foo.el: >> >> > (defun foo () "foo doc string" >> >> > (lambda (bar) "lambda doc string" (car bar))) >> >> > (vi) With point after the function, C-x C-e to evaluate it. > >> >> > (vii) M-: (native-compile 'foo) >> >> > This returns # >> >> > (viii) M-: (foo) >> >> > This returns the lambda form as a byte-compiled function. This is a bug: >> >> > it should return the lambda form as a native-compiled function. > >> >> > Note: this bug is also in the emacs-29 branch. > >> >> Hi Alan, > >> >> I can reproduce, (native-compile 'foo) compiles only foo, compiling the >> >> whole compilation unit with eg `emacs-lisp-native-compile-and-load' >> >> compiles as expected also the inner lambda. > >> > Why would compiling a .el file compile inner lambda forms, but >> > native-compile doesn't? > >> >> I'm not 100% convinced this behaviour is a bug tho. > >> > I don't understand that. Why might it be incorrect to compile that inner >> > lambda natively? > >> Hi Alan, > >> I'm not saying it would be incorrect. I'm suggesting that if is not >> specified what's the expected behaviour of compiling by name the outer >> lambda it might not be a bug. > >> When we compile a whole compilation unit we indeed have to compile all >> functions, in this case what we promised is I think not defined. > > I still don't understand that. The doc string for native-compile says: > > Compile FUNCTION-OR-FILE into native code. > > .. I can't see any reason not also to compile inner lambda functions > natively. > > Anyhow, to fix this bug (if such it be) is easy: > > diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el > index 181e5ca96a1..2360fbaa494 100644 > --- a/lisp/emacs-lisp/comp.el > +++ b/lisp/emacs-lisp/comp.el > @@ -1359,7 +1359,12 @@ comp-add-func-to-ctxt > (comp-ctxt-top-level-forms comp-ctxt) > (list (make-byte-to-native-func-def :name function-name > :c-name c-name))) > - (comp-add-func-to-ctxt func)))) > + (comp-add-func-to-ctxt func)) > + ;; Handle any lambda functions in BYTE-CODE. > + (maphash (lambda (key val) > + (unless (eq key (aref byte-code 1)) > + (comp-intern-func-in-ctxt key val))) > + byte-to-native-lambdas-h))) > > (cl-defmethod comp-spill-lap-function ((form list)) > "Byte-compile FORM, spilling data from the byte compiler." > > > What do you say? LGTM as long as indeed it does not regress any test. Speaking of which with the patch I guess we want a test to cover this. > Incidentally, the code in the various comp-spill-lap-function methods > together with comp-intern-func-in-ctxt appears to have some code > duplication. Would it be possible to have the symbol and list methods of > comp-spill-lap-function simply call comp-intern-func-in-ctxt the way the > string method does? That would simplify those two methods quite a bit. Mmmh maybe, I think one has to try to see if the result is satisfactory. Thanks Andrea From unknown Sat Sep 06 05:55:21 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Alan Mackenzie Subject: bug#64646: closed (Re: bug#64646: Master: Native compiler doesn't always compile lambda forms.) Message-ID: References: X-Gnu-PR-Message: they-closed 64646 X-Gnu-PR-Package: emacs Reply-To: 64646@debbugs.gnu.org Date: Wed, 08 Nov 2023 21:01:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1699477262-19642-1" This is a multi-part message in MIME format... ------------=_1699477262-19642-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #64646: Master: Native compiler doesn't always compile lambda forms. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 64646@debbugs.gnu.org. --=20 64646: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64646 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1699477262-19642-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 64646-done) by debbugs.gnu.org; 8 Nov 2023 21:00:34 +0000 Received: from localhost ([127.0.0.1]:46375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0pf7-00055g-SO for submit@debbugs.gnu.org; Wed, 08 Nov 2023 16:00:34 -0500 Received: from mail.muc.de ([193.149.48.3]:27694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0pf3-00055P-6U for 64646-done@debbugs.gnu.org; Wed, 08 Nov 2023 16:00:32 -0500 Received: (qmail 15465 invoked by uid 3782); 8 Nov 2023 21:59:44 +0100 Received: from acm.muc.de (p4fe1584b.dip0.t-ipconnect.de [79.225.88.75]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 08 Nov 2023 21:59:43 +0100 Received: (qmail 25924 invoked by uid 1000); 8 Nov 2023 20:59:42 -0000 Date: Wed, 8 Nov 2023 20:59:42 +0000 To: Andrea Corallo Subject: Re: bug#64646: Master: Native compiler doesn't always compile lambda forms. Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64646-done Cc: acm@muc.de, 64646-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Andrea. On Thu, Nov 02, 2023 at 13:32:21 -0400, Andrea Corallo wrote: > Alan Mackenzie writes: > > This bug doesn't seem to be moving, so .... > > On Wed, Jul 26, 2023 at 10:57:01 -0400, Andrea Corallo wrote: > >> Alan Mackenzie writes: > >> >> I'm not 100% convinced this behaviour is a bug tho. > >> > I don't understand that. Why might it be incorrect to compile that inner > >> > lambda natively? > >> Hi Alan, > >> I'm not saying it would be incorrect. I'm suggesting that if is not > >> specified what's the expected behaviour of compiling by name the outer > >> lambda it might not be a bug. > >> When we compile a whole compilation unit we indeed have to compile all > >> functions, in this case what we promised is I think not defined. > > I still don't understand that. The doc string for native-compile says: > > Compile FUNCTION-OR-FILE into native code. > > .. I can't see any reason not also to compile inner lambda functions > > natively. > > Anyhow, to fix this bug (if such it be) is easy: > > diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el > > index 181e5ca96a1..2360fbaa494 100644 > > --- a/lisp/emacs-lisp/comp.el > > +++ b/lisp/emacs-lisp/comp.el > > @@ -1359,7 +1359,12 @@ comp-add-func-to-ctxt > > (comp-ctxt-top-level-forms comp-ctxt) > > (list (make-byte-to-native-func-def :name function-name > > :c-name c-name))) > > - (comp-add-func-to-ctxt func)))) > > + (comp-add-func-to-ctxt func)) > > + ;; Handle any lambda functions in BYTE-CODE. > > + (maphash (lambda (key val) > > + (unless (eq key (aref byte-code 1)) > > + (comp-intern-func-in-ctxt key val))) > > + byte-to-native-lambdas-h))) > > (cl-defmethod comp-spill-lap-function ((form list)) > > "Byte-compile FORM, spilling data from the byte compiler." > > What do you say? > LGTM as long as indeed it does not regress any test. Speaking of which > with the patch I guess we want a test to cover this. Thanks. I've committed a patch for this, including two extra tests which test that a nested lambda function also gets native compiled. I'm closing the bug with this post. > > Incidentally, the code in the various comp-spill-lap-function methods > > together with comp-intern-func-in-ctxt appears to have some code > > duplication. Would it be possible to have the symbol and list methods of > > comp-spill-lap-function simply call comp-intern-func-in-ctxt the way the > > string method does? That would simplify those two methods quite a bit. > Mmmh maybe, I think one has to try to see if the result is satisfactory. I've done this refactoring too. The symbol and list methods for comp-spill-lap-function now have 17 and 15 lines respectively. I hope you like it! > Thanks > Andrea -- Alan Mackenzie (Nuremberg, Germany). ------------=_1699477262-19642-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Jul 2023 12:10:22 +0000 Received: from localhost ([127.0.0.1]:44315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKe6Q-0003Qf-A1 for submit@debbugs.gnu.org; Sat, 15 Jul 2023 08:10:22 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKe6N-0003QQ-US for submit@debbugs.gnu.org; Sat, 15 Jul 2023 08:10:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKe6I-0002tA-DB for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 08:10:14 -0400 Received: from mx3.muc.de ([193.149.48.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKe6G-0006Es-AF for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 08:10:14 -0400 Received: (qmail 16277 invoked by uid 3782); 15 Jul 2023 14:10:07 +0200 Received: from acm.muc.de (pd953a5ce.dip0.t-ipconnect.de [217.83.165.206]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 15 Jul 2023 14:10:06 +0200 Received: (qmail 18875 invoked by uid 1000); 15 Jul 2023 12:10:06 -0000 Date: Sat, 15 Jul 2023 12:10:06 +0000 To: bug-gnu-emacs@gnu.org Subject: Master: Native compiler doesn't always compile lambda forms. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) In the master branch: (i) emacs -Q (ii) C-x b foo.el (iii) Insert into foo.el: ;; -*- lexical-binding:t -*- (iv) M-x emacs-lisp-mode (v) Insert into foo.el: (defun foo () "foo doc string" (lambda (bar) "lambda doc string" (car bar))) (vi) With point after the function, C-x C-e to evaluate it. (vii) M-: (native-compile 'foo) This returns # (viii) M-: (foo) This returns the lambda form as a byte-compiled function. This is a bug: it should return the lambda form as a native-compiled function. Note: this bug is also in the emacs-29 branch. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1699477262-19642-1-- From unknown Sat Sep 06 05:55:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64646: Master: Native compiler doesn't always compile lambda forms. Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Nov 2023 10:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 64646-done@debbugs.gnu.org Received: via spool by 64646-done@debbugs.gnu.org id=D64646.169952459212223 (code D ref 64646); Thu, 09 Nov 2023 10:10:02 +0000 Received: (at 64646-done) by debbugs.gnu.org; 9 Nov 2023 10:09:52 +0000 Received: from localhost ([127.0.0.1]:46816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r11yu-0003B1-Hj for submit@debbugs.gnu.org; Thu, 09 Nov 2023 05:09:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r11yr-0003Al-IK for 64646-done@debbugs.gnu.org; Thu, 09 Nov 2023 05:09:47 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r11y9-0003qO-26; Thu, 09 Nov 2023 05:09:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=BMKofEPAoUYN8V9uQIYV4bW7hQBrcifYCPXZwi3tBSQ=; b=ScfhvideliGZCIKOxLQT WK1So28tstKHZR82jWSp/lnyCDkKVMyBX9qggSNTJWPrPOD9u/SPXEjvFtPsgNkQHO/E1dH5WOH2w ioUi6+JKOs6CpNnF/KbMtzrDpQTcC2EURKE38/gfFW9XxxrZu5jNwMie9diVzY51xei1YC84i8Qua +WEUVQ8pIngFm9pnBhf6cCYQxKWOKeBSjNwC8+HAdKozTc9J0uI8845pl0bi3LoW4Pn9ilBhVBgj9 3kIPyCG5/8x5UF22cIYGPmvBkoc1E+mBO5yx7uGFGItrMQhVGmFlaPntRkEdyl6Ar3YoPHDsF0v3h atr1+eeISNC5/w==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1r11y7-0001Uu-3n; Thu, 09 Nov 2023 05:09:00 -0500 From: Andrea Corallo In-Reply-To: (Alan Mackenzie's message of "Wed, 8 Nov 2023 20:59:42 +0000") References: Date: Thu, 09 Nov 2023 05:08:59 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > Hello, Andrea. > > On Thu, Nov 02, 2023 at 13:32:21 -0400, Andrea Corallo wrote: >> Alan Mackenzie writes: > >> > This bug doesn't seem to be moving, so .... > >> > On Wed, Jul 26, 2023 at 10:57:01 -0400, Andrea Corallo wrote: >> >> Alan Mackenzie writes: > >> >> >> I'm not 100% convinced this behaviour is a bug tho. > >> >> > I don't understand that. Why might it be incorrect to compile that inner >> >> > lambda natively? > >> >> Hi Alan, > >> >> I'm not saying it would be incorrect. I'm suggesting that if is not >> >> specified what's the expected behaviour of compiling by name the outer >> >> lambda it might not be a bug. > >> >> When we compile a whole compilation unit we indeed have to compile all >> >> functions, in this case what we promised is I think not defined. > >> > I still don't understand that. The doc string for native-compile says: > >> > Compile FUNCTION-OR-FILE into native code. > >> > .. I can't see any reason not also to compile inner lambda functions >> > natively. > >> > Anyhow, to fix this bug (if such it be) is easy: > >> > diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el >> > index 181e5ca96a1..2360fbaa494 100644 >> > --- a/lisp/emacs-lisp/comp.el >> > +++ b/lisp/emacs-lisp/comp.el >> > @@ -1359,7 +1359,12 @@ comp-add-func-to-ctxt >> > (comp-ctxt-top-level-forms comp-ctxt) >> > (list (make-byte-to-native-func-def :name function-name >> > :c-name c-name))) >> > - (comp-add-func-to-ctxt func)))) >> > + (comp-add-func-to-ctxt func)) >> > + ;; Handle any lambda functions in BYTE-CODE. >> > + (maphash (lambda (key val) >> > + (unless (eq key (aref byte-code 1)) >> > + (comp-intern-func-in-ctxt key val))) >> > + byte-to-native-lambdas-h))) > >> > (cl-defmethod comp-spill-lap-function ((form list)) >> > "Byte-compile FORM, spilling data from the byte compiler." > > >> > What do you say? > >> LGTM as long as indeed it does not regress any test. Speaking of which >> with the patch I guess we want a test to cover this. > > Thanks. I've committed a patch for this, including two extra tests which > test that a nested lambda function also gets native compiled. > > I'm closing the bug with this post. > >> > Incidentally, the code in the various comp-spill-lap-function methods >> > together with comp-intern-func-in-ctxt appears to have some code >> > duplication. Would it be possible to have the symbol and list methods of >> > comp-spill-lap-function simply call comp-intern-func-in-ctxt the way the >> > string method does? That would simplify those two methods quite a bit. > >> Mmmh maybe, I think one has to try to see if the result is satisfactory. > > I've done this refactoring too. The symbol and list methods for > comp-spill-lap-function now have 17 and 15 lines respectively. I hope > you like it! Look nice thanks! Andrea