From unknown Sat Jun 21 05:07:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12119 <12119@debbugs.gnu.org> To: bug#12119 <12119@debbugs.gnu.org> Subject: Status: 24.1.50; symbol-macrolet regresssion Reply-To: bug#12119 <12119@debbugs.gnu.org> Date: Sat, 21 Jun 2025 12:07:05 +0000 retitle 12119 24.1.50; symbol-macrolet regresssion reassign 12119 emacs submitter 12119 Helmut Eller severity 12119 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 09:21:00 2012 Received: (at submit) by debbugs.gnu.org; 2 Aug 2012 13:21:00 +0000 Received: from localhost ([127.0.0.1]:56433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwvKl-0002Qw-Ib for submit@debbugs.gnu.org; Thu, 02 Aug 2012 09:21:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41030) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwvKk-0002Qp-7f for submit@debbugs.gnu.org; Thu, 02 Aug 2012 09:20:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwvDP-0006IF-N2 for submit@debbugs.gnu.org; Thu, 02 Aug 2012 09:13:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:39800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwvDP-0006IB-Ja for submit@debbugs.gnu.org; Thu, 02 Aug 2012 09:13:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwvDG-00055v-5G for bug-gnu-emacs@gnu.org; Thu, 02 Aug 2012 09:13:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwvDA-0006Fr-3l for bug-gnu-emacs@gnu.org; Thu, 02 Aug 2012 09:13:14 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:38114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwvD9-0006FW-Tz for bug-gnu-emacs@gnu.org; Thu, 02 Aug 2012 09:13:08 -0400 Received: by wibhm11 with SMTP id hm11so3770629wib.12 for ; Thu, 02 Aug 2012 06:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=8wIBCf3IH1AkIopSX8TeT2Asxjmm8ZQzyvgBB4nmafY=; b=mgL5OWS89aZUZU5Y524lYL8n4G7io5X/cS2Kie98XnGaQ9bJ7JJNH4k843+q/9c1zP +l/r3pRc7ob9sxsFg84kYtPVccJO/k8k52TjLPsbLlieYqeJWuDHk119LCg8XtM6Hoep +DOSn5urfue59knfjJdeVE2OTVKiyj1Bp5NA3+irHqjMH28bZauNh0DnYaRyaKZqk4GH jDZMqoizheu0xGwDob5NmL0VH1BGvOec3+wo447OFcmXY6TVyNU82ywZCztPodmIA7nI kdXm6O70YABccb8g+HO4e7iETHdS/6Gi/4d2HF7D8kYfnvs0XKDyeGyGthFQRGiH/ALP 0Q9A== Received: by 10.216.41.195 with SMTP id h45mr11233442web.74.1343913186775; Thu, 02 Aug 2012 06:13:06 -0700 (PDT) Received: from ix (dial-176254.pool.broadband44.net. [212.46.176.254]) by mx.google.com with ESMTPS id fr4sm17178735wib.8.2012.08.02.06.13.05 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Aug 2012 06:13:06 -0700 (PDT) Received: from helmut by ix with local (Exim 4.72) (envelope-from ) id 1SwvD5-0006O9-61 for bug-gnu-emacs@gnu.org; Thu, 02 Aug 2012 15:13:03 +0200 From: Helmut Eller To: bug-gnu-emacs@gnu.org Subject: 24.1.50; symbol-macrolet regresssion Date: Thu, 02 Aug 2012 15:13:03 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) In Emacs 24, bzr revno 109393, this file (require 'cl) (defun foo () (let ((outer '42)) (symbol-macrolet ((x outer)) (let ((x 'inner)) (assert (eq x 'inner)))))) (foo) when executed with: emacs -Q -batch -l symbol-macrolet.el produces: Assertion failed: (eq x (quote inner)) With Emacs 22 the assertions doesn't fail. Also, in Emacs 22 the macroepansion (via cl-macroexpand-all) produces something like (let ((outer '42)) (let ((outer 'inner)) (progn (or (eq outer 'inner) (signal 'cl-assertion-failed (list '(eq x 'inner)))) nil))) while in Emacs 24 it looks like (let ((outer '42)) (progn (let ((x 'inner)) (progn (or (eq outer 'inner) (signal 'cl-assertion-failed (list '(eq x 'inner)))) nil)))) Such a change should be documented. In GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2012-08-02 on ix Bzr revision: 109400 eggert@cs.ucla.edu-20120802104919-u42w0m8vbqm4p2l4 Windowing system distributor `The X.Org Foundation', version 11.0.10707000 Configured using: `configure '--with-jpeg=no' '--with-gif=no' '--with-tiff=no'' Important settings: value of $LANG: en_US locale-coding-system: iso-latin-1-unix default enable-multibyte-characters: nil From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 04 19:48:36 2012 Received: (at 12119) by debbugs.gnu.org; 4 Aug 2012 23:48:36 +0000 Received: from localhost ([127.0.0.1]:34144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sxo5D-0008U2-JN for submit@debbugs.gnu.org; Sat, 04 Aug 2012 19:48:36 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:38353) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sxo5A-0008Tv-Nf for 12119@debbugs.gnu.org; Sat, 04 Aug 2012 19:48:33 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q74NekjS017925; Sat, 4 Aug 2012 19:40:47 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 390F4AE2FA; Sat, 4 Aug 2012 19:40:46 -0400 (EDT) From: Stefan Monnier To: Helmut Eller Subject: Re: bug#12119: 24.1.50; symbol-macrolet regresssion Message-ID: References: Date: Sat, 04 Aug 2012 19:40:46 -0400 In-Reply-To: (Helmut Eller's message of "Thu, 02 Aug 2012 15:13:03 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4300=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4300> : streams <794573> : uri <1183946> X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 12119 Cc: 12119@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > Also, in Emacs 22 the macroepansion (via cl-macroexpand-all) > produces something like > (let ((outer '42)) > (let ((outer 'inner)) > (progn > (or > (eq outer 'inner) > (signal 'cl-assertion-failed > (list > '(eq x 'inner)))) > nil))) While the above expansion returns the right value, it is not correct. The right expansion would be (let ((outer '42)) (let ((x 'inner)) (progn (or (eq x 'inner) (signal 'cl-assertion-failed (list '(eq x 'inner)))) nil))) > while in Emacs 24 it looks like > (let ((outer '42)) > (progn > (let ((x 'inner)) > (progn > (or > (eq outer 'inner) > (signal 'cl-assertion-failed > (list > '(eq x 'inner)))) > nil)))) > Such a change should be documented. That's an accident, so it shouldn't be documented. The new code is no better than the old one, and arguably slightly worse since it fails in your test while the old code worked. I'm not yet sure how we can fix it properly, tho. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 05 07:46:38 2012 Received: (at 12119) by debbugs.gnu.org; 5 Aug 2012 11:46:38 +0000 Received: from localhost ([127.0.0.1]:34786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SxzI5-0007uZ-RF for submit@debbugs.gnu.org; Sun, 05 Aug 2012 07:46:38 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:40806) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SxzI3-0007uS-IH for 12119@debbugs.gnu.org; Sun, 05 Aug 2012 07:46:36 -0400 Received: by weyu54 with SMTP id u54so1454210wey.3 for <12119@debbugs.gnu.org>; Sun, 05 Aug 2012 04:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=CcFvDznpL29yvpeK+RnLgW+CteSHsLvNlbUbPD8JGqs=; b=dVZNYHckYJvxrM+f5MEWu6SeN+Cjgx0KHmz11bhnL5rC9dZGlZfb+MebqRZnIqIxOT 56rvz4XGVZSUDIYgJf/F6mq2y9qNbC9tytV4OBy6sh6qc5qwrbY0qS9fhDAPJG0ld3Lf cpxAxWgjt73KlovvNPOuJCcsvFsK7JbKSHSGsuJKaUsqNtn9dadcnZKCoJoPalkemM2Y C1NE1DaWAWmkjatDR8nLWgnxMeDrWhPkpRFalRgE+CtEhi7IA8mgOXhuhFxvH31W6BNy ZsnZZzaNpFu73d1ZSQxIGSpT8Lr14iUSpI3LEcqbomi+TjJhrxyrCMaFVCaNwbHO7tMi RDTA== Received: by 10.180.78.135 with SMTP id b7mr10425928wix.11.1344166728024; Sun, 05 Aug 2012 04:38:48 -0700 (PDT) Received: from ix (dial-182251.pool.broadband44.net. [212.46.182.251]) by mx.google.com with ESMTPS id b7sm13439310wiz.9.2012.08.05.04.38.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Aug 2012 04:38:47 -0700 (PDT) Received: from helmut by ix with local (Exim 4.72) (envelope-from ) id 1SxzAT-0000VY-VA; Sun, 05 Aug 2012 13:38:45 +0200 From: Helmut Eller To: Stefan Monnier Subject: Re: bug#12119: 24.1.50; symbol-macrolet regresssion References: Date: Sun, 05 Aug 2012 13:38:45 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 04 Aug 2012 19:40:46 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12119 Cc: 12119@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On Sun, Aug 05 2012, Stefan Monnier wrote: >> Also, in Emacs 22 the macroepansion (via cl-macroexpand-all) >> produces something like > >> (let ((outer '42)) >> (let ((outer 'inner)) >> (progn >> (or >> (eq outer 'inner) >> (signal 'cl-assertion-failed >> (list >> '(eq x 'inner)))) >> nil))) > > While the above expansion returns the right value, it is not correct. > The right expansion would be > > (let ((outer '42)) > (let ((x 'inner)) > (progn > (or > (eq x 'inner) > (signal 'cl-assertion-failed > (list > '(eq x 'inner)))) > nil))) > >> while in Emacs 24 it looks like > >> (let ((outer '42)) >> (progn >> (let ((x 'inner)) >> (progn >> (or >> (eq outer 'inner) >> (signal 'cl-assertion-failed >> (list >> '(eq x 'inner)))) >> nil)))) > >> Such a change should be documented. > > That's an accident, so it shouldn't be documented. The new code is no > better than the old one, and arguably slightly worse since it fails in > your test while the old code worked. > I'm not yet sure how we can fix it properly, tho. Well, it depends on the definition of "correct". The old version seems to do what the documentation says, i.e., let binding the variable is treated like letf. What you call "correct" may be closer to what ANSI CL does, but such a change should be documented. Either way, I don't see the point in breaking existing code. Helmut From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 06 12:28:14 2012 Received: (at 12119) by debbugs.gnu.org; 6 Aug 2012 16:28:14 +0000 Received: from localhost ([127.0.0.1]:37736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SyQAA-0000QU-1f for submit@debbugs.gnu.org; Mon, 06 Aug 2012 12:28:14 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52457) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SyQA8-0000QO-Ft for 12119@debbugs.gnu.org; Mon, 06 Aug 2012 12:28:12 -0400 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q76GKI62015015; Mon, 6 Aug 2012 12:20:18 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 60A24B41E3; Mon, 6 Aug 2012 12:20:18 -0400 (EDT) From: Stefan Monnier To: Helmut Eller Subject: Re: bug#12119: 24.1.50; symbol-macrolet regresssion Message-ID: References: Date: Mon, 06 Aug 2012 12:20:18 -0400 In-Reply-To: (Helmut Eller's message of "Sun, 05 Aug 2012 13:38:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4302=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4302> : streams <795356> : uri <1185307> X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 12119 Cc: 12119@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > Well, it depends on the definition of "correct". The old version seems > to do what the documentation says, i.e., let binding the variable is > treated like letf. What you call "correct" may be closer to what ANSI > CL does, but such a change should be documented. Oh, I missed this "let -> letf" mapping of the old code. Now it makes more sense, thank you. I'll try and reproduce the old behavior then. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 06 16:02:51 2012 Received: (at 12119-done) by debbugs.gnu.org; 6 Aug 2012 20:02:51 +0000 Received: from localhost ([127.0.0.1]:38042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SyTVq-000722-L5 for submit@debbugs.gnu.org; Mon, 06 Aug 2012 16:02:51 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:40850) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SyTVo-00071v-3X for 12119-done@debbugs.gnu.org; Mon, 06 Aug 2012 16:02:49 -0400 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q76Jsq3R006286; Mon, 6 Aug 2012 15:54:53 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 2C9BFB41E3; Mon, 6 Aug 2012 15:54:47 -0400 (EDT) From: Stefan Monnier To: Helmut Eller Subject: Re: bug#12119: 24.1.50; symbol-macrolet regresssion Message-ID: References: Date: Mon, 06 Aug 2012 15:54:47 -0400 In-Reply-To: (Helmut Eller's message of "Sun, 05 Aug 2012 13:38:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4302=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4302> : streams <795443> : uri <1185471> X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 12119-done Cc: 12119-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > Well, it depends on the definition of "correct". The old version seems > to do what the documentation says, i.e., let binding the variable is > treated like letf. What you call "correct" may be closer to what ANSI > CL does, but such a change should be documented. I've installed a patch which should re-produce the old letf behavior. Stefan =3D=3D=3D modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-06 07:31:31 +0000 +++ lisp/ChangeLog 2012-08-06 19:51:40 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl--sm-macroexpand): Fix handling of + re-binding a symbol that has a symbol-macro (bug#12119). + 2012-08-06 Mohsen BANAN =20 * language/persian.el: New file. (Bug#11812) =3D=3D=3D modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/cl-macs.el 2012-08-06 19:49:54 +0000 @@ -1668,31 +1668,86 @@ cl--old-macroexpand (symbol-function 'macroexpand))) =20 -(defun cl--sm-macroexpand (cl-macro &optional cl-env) +(defun cl--sm-macroexpand (exp &optional env) "Special macro expander used inside `cl-symbol-macrolet'. This function replaces `macroexpand' during macro expansion of `cl-symbol-macrolet', and does the same thing as `macroexpand' except that it additionally expands symbol macros." - (let ((macroexpand-all-environment cl-env)) + (let ((macroexpand-all-environment env)) (while (progn - (setq cl-macro (funcall cl--old-macroexpand cl-macro cl-env)) - (cond - ((symbolp cl-macro) + (setq exp (funcall cl--old-macroexpand exp env)) + (pcase exp + ((pred symbolp) ;; Perform symbol-macro expansion. - (when (cdr (assq (symbol-name cl-macro) cl-env)) - (setq cl-macro (cadr (assq (symbol-name cl-macro) cl-env))))) - ((eq 'setq (car-safe cl-macro)) + (when (cdr (assq (symbol-name exp) env)) + (setq exp (cadr (assq (symbol-name exp) env))))) + (`(setq . ,_) ;; Convert setq to setf if required by symbol-macro expansion. - (let* ((args (mapcar (lambda (f) (cl--sm-macroexpand f cl-env)) - (cdr cl-macro))) + (let* ((args (mapcar (lambda (f) (cl--sm-macroexpand f env)) + (cdr exp))) (p args)) (while (and p (symbolp (car p))) (setq p (cddr p))) - (if p (setq cl-macro (cons 'setf args)) - (setq cl-macro (cons 'setq args)) + (if p (setq exp (cons 'setf args)) + (setq exp (cons 'setq args)) ;; Don't loop further. - nil)))))) - cl-macro)) + nil))) + (`(,(or `let `let*) . ,(or `(,bindings . ,body) dontcare)) + ;; CL's symbol-macrolet treats re-bindings as candidates for + ;; expansion (turning the let into a letf if needed), contrar= y to + ;; Common-Lisp where such re-bindings hide the symbol-macro. + (let ((letf nil) (found nil) (nbs ())) + (dolist (binding bindings) + (let* ((var (if (symbolp binding) binding (car binding))) + (sm (assq (symbol-name var) env))) + (push (if (not (cdr sm)) + binding + (let ((nexp (cadr sm))) + (setq found t) + (unless (symbolp nexp) (setq letf t)) + (cons nexp (cdr-safe binding)))) + nbs))) + (when found + (setq exp `(,(if letf + (if (eq (car exp) 'let) 'cl-letf 'cl-let= f*) + (car exp)) + ,(nreverse nbs) + ,@body))))) + ;; FIXME: The behavior of CL made sense in a dynamically scoped + ;; language, but for lexical scoping, Common-Lisp's behavior m= ight + ;; 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. + ;; (`(,(or `let `let*) . ,(or `(,bindings . ,body) dontcare)) + ;; (let ((nbs ()) (found nil)) + ;; (dolist (binding bindings) + ;; (let* ((var (if (symbolp binding) binding (car binding= ))) + ;; (name (symbol-name var)) + ;; (val (and found (consp binding) (eq 'let* (car = exp)) + ;; (list (macroexpand-all (cadr binding) + ;; env))))) + ;; (push (if (assq name env) + ;; ;; This binding should hide its symbol-mac= ro, + ;; ;; but given the way macroexpand-all works= , we + ;; ;; can't prevent application of `env' to t= he + ;; ;; sub-expressions, so we need to =CE=B1-r= ename this + ;; ;; variable instead. + ;; (let ((nvar (make-symbol + ;; (copy-sequence name)))) + ;; (setq found t) + ;; (push (list name nvar) env) + ;; (cons nvar (or val (cdr-safe binding)))) + ;; (if val (cons var val) binding)) + ;; nbs))) + ;; (when found + ;; (setq exp `(,(car exp) + ;; ,(nreverse nbs) + ;; ,@(macroexp-unprogn + ;; (macroexpand-all (macroexp-progn body) + ;; env))))) + ;; nil)) + ))) + exp)) =20 ;;;###autoload (defmacro cl-symbol-macrolet (bindings &rest body) From unknown Sat Jun 21 05:07:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 04 Sep 2012 11:24:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator