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#26073: workaround Date: Tue, 26 Sep 2017 10:38:36 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506437284 31184 195.159.176.226 (26 Sep 2017 14:48:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2017 14:48:04 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 26073@debbugs.gnu.org To: Paul Pogonyshev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 26 16:48:00 2017 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 1dwr9N-0007SI-L3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Sep 2017 16:47:53 +0200 Original-Received: from localhost ([::1]:47939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwr9V-0004wV-1B for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Sep 2017 10:48:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwr0r-0007fb-9B for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2017 10:39:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwr0o-0006vt-Lu for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2017 10:39:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52852) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwr0o-0006vh-IA for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2017 10:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dwr0o-0002oZ-9K for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2017 10:39: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: Tue, 26 Sep 2017 14:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.150643672310792 (code B ref 26073); Tue, 26 Sep 2017 14:39:02 +0000 Original-Received: (at 26073) by debbugs.gnu.org; 26 Sep 2017 14:38:43 +0000 Original-Received: from localhost ([127.0.0.1]:33300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwr0V-0002nu-Iw for submit@debbugs.gnu.org; Tue, 26 Sep 2017 10:38:43 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:60172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwr0S-0002ng-RH; Tue, 26 Sep 2017 10:38:42 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v8QEcal0008990; Tue, 26 Sep 2017 10:38:38 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id AACA766262; Tue, 26 Sep 2017 10:38:36 -0400 (EDT) In-Reply-To: (Paul Pogonyshev's message of "Mon, 20 Mar 2017 10:22:57 +0100") 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, RV6124=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6124> : inlines <6090> : streams <1764695> : uri <2506894> 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:137461 Archived-At: retitle 26073 How should cl-symbol-macrolet interact with rebindings? thanks The problem here is indeed different from the one in bug#26068. bug#26068 was clearly triggering a (known) bug in cl-symbol-macrolet. Here it's triggering a (known) misfeature. The source code has the following comments about it: ;; CL's symbol-macrolet treats re-bindings as candidates for ;; expansion (turning the let into a letf if needed), contrary to ;; Common-Lisp where such re-bindings hide the symbol-macro. and ;; FIXME: The behavior of CL made sense in a dynamically scoped ;; language, but for lexical scoping, Common-Lisp's behavior might ;; make more sense (and indeed, CL behaves like Common-Lisp w.r.t ;; lexical-let), so maybe we should adjust the behavior based on ;; the use of lexical-binding. more concretely cl-symbol-macrolet implements the following semantics: (cl-symbol-macrolet ((x )) ... (let ((x )) ..x..)) => ... (cl-letf (( )) ....) whereas Common-Lisp's symbol-macrolet wants the following semantics instead: => ... (let ((x )) ..x..) As mentioned in the comment, it probably makes sense to change cl-symbol-macrolet in lexical-binding code to follow Common-Lisp's semantics (tho we'd want to give access to the old semantics if the user explicitly uses cl-letf). Not sure what might break if we do that: the main user of cl-symbol-macrolet outside of generator.el AFAIK is the with-slots of eieio, so the question is whether some users of with-slots expect a subsequent `let` binding to temporarily change the slot's value. I just checked and it seems that no code in Emacs itself relies on this behavior, so maybe it's "safe" to change it. Stefan