From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#31792: 27.0.50; Regression in #'labels, recent versions Date: Wed, 13 Jun 2018 23:32:02 -0400 Message-ID: References: <5b1f.0188.5dc11.f21c@parhasard.net> <878t7kzyqs.fsf@gmail.com> <87k1r3y5m2.fsf@gmail.com> <87muvyvym5.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528947130 20652 195.159.176.226 (14 Jun 2018 03:32:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2018 03:32:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Aidan Kehoe , 31792@debbugs.gnu.org, Alan Mackenzie To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 14 05:32:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fTIzV-0005DF-Qj for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Jun 2018 05:32:05 +0200 Original-Received: from localhost ([::1]:37982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTJ1b-0004FZ-32 for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jun 2018 23:34:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTJ0V-0003p7-82 for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2018 23:33:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTJ0Q-0002Fo-8A for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2018 23:33:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39251) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTJ0Q-0002Fk-4X for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2018 23:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fTJ0P-0002wr-Uo for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2018 23:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jun 2018 03:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31792 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 31792-submit@debbugs.gnu.org id=B31792.152894712711262 (code B ref 31792); Thu, 14 Jun 2018 03:33:01 +0000 Original-Received: (at 31792) by debbugs.gnu.org; 14 Jun 2018 03:32:07 +0000 Original-Received: from localhost ([127.0.0.1]:47147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fTIzW-0002vZ-TG for submit@debbugs.gnu.org; Wed, 13 Jun 2018 23:32:07 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:36864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fTIzV-0002vR-44 for 31792@debbugs.gnu.org; Wed, 13 Jun 2018 23:32:06 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w5E3WVGe026409; Wed, 13 Jun 2018 23:32:31 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 613BE660EB; Wed, 13 Jun 2018 23:32:02 -0400 (EDT) In-Reply-To: <87muvyvym5.fsf@gmail.com> (Noam Postavsky's message of "Wed, 13 Jun 2018 23:24:50 -0400") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6307=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6307> : inlines <6696> : streams <1789622> : uri <2657827> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147395 Archived-At: > (defmacro cl-flet (bindings &rest body) > "Make local function definitions. > -Like `cl-labels' but the definitions are not recursive. > +Bind the function cells of symbols within FORM. I think this is wrong: it makes it sound like it does `fset`, which is what CL's `flet` did, but not what `cl-flet` does. If you look at the implementation, you'll see that it doesn't touch any "function cell". > +The bindings only take effect within FORM, not BODY, so you can't > +write recursive function definitions. Use `cl-labels' for that. > +See info node `(cl) Function Bindings' for details. This is good, thanks. > (defmacro cl-labels (bindings &rest body) > - "Make temporary function bindings. > -The bindings can be recursive and the scoping is lexical, but capturing them > -in closures will only work if `lexical-binding' is in use. > + "Make local function definitions. > +Bind the function cells of symbols within FORM. Same here about "function cells". > diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el > index d53c8e0bbc..f6643158d2 100644 > --- a/lisp/emacs-lisp/cl.el > +++ b/lisp/emacs-lisp/cl.el > @@ -466,9 +466,12 @@ labels > (push var sets) > (push (cons (car binding) > `(lambda (&rest cl-labels-args) > - (cl-list* 'funcall ',var > - cl-labels-args))) > + (if (eq (car cl-labels-args) cl--labels-magic) > + (list cl--labels-magic ',var) > + (cl-list* 'funcall ',var cl-labels-args)))) > newenv))) > + ;; `lexical-let' adds `cl--function-convert' (which calls > + ;; `cl--labels-convert') as a macroexpander for `function'. > (macroexpand-all `(lexical-let ,vars (setq ,@sets) ,@body) newenv))) Good, thanks. Stefan