From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#65017: 29.1; Byte compiler interaction with cl-lib function objects, removes symbol-function Date: Sat, 12 Aug 2023 16:46:42 +0000 Message-ID: References: <8B08E514-B2D5-48F5-BA90-4F5A9492F8F9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28939"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 65017@debbugs.gnu.org, Eric Marsden To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 12 18:47:15 2023 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 1qUrli-0007Jn-G8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Aug 2023 18:47:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUrlY-0002yk-Jq; Sat, 12 Aug 2023 12:47:04 -0400 Original-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 1qUrlW-0002yN-8G for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 12:47:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qUrlW-0007dX-10 for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 12:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUrlV-0001kX-Rt for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 12:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Aug 2023 16:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65017 X-GNU-PR-Package: emacs Original-Received: via spool by 65017-submit@debbugs.gnu.org id=B65017.16918588166714 (code B ref 65017); Sat, 12 Aug 2023 16:47:01 +0000 Original-Received: (at 65017) by debbugs.gnu.org; 12 Aug 2023 16:46:56 +0000 Original-Received: from localhost ([127.0.0.1]:56742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUrlQ-0001kD-6L for submit@debbugs.gnu.org; Sat, 12 Aug 2023 12:46:56 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:57604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUrlK-0001jv-IS for 65017@debbugs.gnu.org; Sat, 12 Aug 2023 12:46:54 -0400 Original-Received: (qmail 74004 invoked by uid 3782); 12 Aug 2023 18:46:43 +0200 Original-Received: from acm.muc.de (p4fe1539a.dip0.t-ipconnect.de [79.225.83.154]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 12 Aug 2023 18:46:43 +0200 Original-Received: (qmail 1784 invoked by uid 1000); 12 Aug 2023 16:46:42 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267317 Archived-At: Hello, Stefan. On Fri, Aug 11, 2023 at 23:28:01 -0400, Stefan Monnier wrote: [ .... ] > >> > Why must the F get replaced by a different F? There must surely be a > >> > way, a simpler way than the current cl--labels-convert, to retain the > >> > current F (hence, not corrupting its position)? > >> There might. The current hack is the best I could come up with. > > I'm not criticising the hack, not at all! But it could be better > > commented, and the doc string for cl--labels-convert could be more > > informative. > It would help if you could send a (rough) patch showing what comment > you'd have liked to see. I'll come up with something as soon as I understand it enough. > > The "why" is missing - why is necessary to handle `function' as > > a macro? > I couldn't really think of any alternative for IT ("it" being to > implement `cl-labels` and `cl-flet`). FWIW, the pre-cl-lib code did IT > differently by duplicating `macroexp--expand-all` wholesale and then > tweaking its handling of `function` in an ad-hoc way. Your reply doesn't address my question. It is not clear to me what the IT in your previous paragraph is. You may or may not have thought of some alternative for IT, and previous code may have done IT differently, but that doesn't help me understand what IT is. What was the difficulty in cl-labels and cl-flet for which IT and cl--labels-convert was the solution? The code is substituting (function F) with a non-eq (function F). You're saying this has some effect in macroexp--expand-all. I can't see that, yet. All I see is FORM, (function F), being substituted by a different (function F) in L327 of macroexp.el. Then there are the pcase arms for (function (lambda ....)) and for (function ....). Are either of these pcase arms affected by the "expansion" of FORM? If so, how? Or am I looking at the wrong place entirely? [ .... ] > > I think it's to inhibit the processing of `function' as function > > somewhere else, but where and why? > It's not a function but a special operator, which is thus handled in > a hard-coded way by `macroexp--expand-all`. Is it the case that this hard-coded handling for function is prevented by the macro "expansion" of (function F)? Otherwise, what is the relevance of this hard-coded handling to cl--labels-convert? [ .... ] > Stefan [ .... ] -- Alan Mackenzie (Nuremberg, Germany).