From unknown Tue Jun 24 06:54:39 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#12758 <12758@debbugs.gnu.org> To: bug#12758 <12758@debbugs.gnu.org> Subject: Status: letf no longer allows unbound variables Reply-To: bug#12758 <12758@debbugs.gnu.org> Date: Tue, 24 Jun 2025 13:54:39 +0000 retitle 12758 letf no longer allows unbound variables reassign 12758 emacs submitter 12758 Glenn Morris severity 12758 normal tag 12758 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 29 03:44:57 2012 Received: (at submit) by debbugs.gnu.org; 29 Oct 2012 07:44:58 +0000 Received: from localhost ([127.0.0.1]:37315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSk1p-0007FL-7M for submit@debbugs.gnu.org; Mon, 29 Oct 2012 03:44:57 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:42229) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSk1n-0007FE-1C for submit@debbugs.gnu.org; Mon, 29 Oct 2012 03:44:55 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TSjzQ-0004lv-Me; Mon, 29 Oct 2012 03:42:28 -0400 From: Glenn Morris To: submit@debbugs.gnu.org Subject: letf no longer allows unbound variables X-Spook: Al-Qaeda Arnett John Kerry oil Montenegro S Key espionage X-Ran: WY1?:Iuy`,j User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.8 (----) 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: -4.8 (----) Package: emacs Version: 24.2.50 In Emacs 24.2, this works: emacs -Q -l cl (letf ((b)) (setq b 99)) Evaluating this returns `99', and leaves `b' unbound. This behaviour is documented in cl.texi: In most cases, the @var{place} must have a well-defined value on entry to the @code{letf} form. The only exceptions are plain variables and calls to @code{symbol-value} and @code{symbol-function}. If the symbol is not bound on entry, it is simply made unbound by @code{makunbound} or @code{fmakunbound} on exit. In current trunk, it throws an error: Symbol's value as variable is void: b cl-letf does no better than letf. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 29 09:49:25 2012 Received: (at 12758) by debbugs.gnu.org; 29 Oct 2012 13:49:25 +0000 Received: from localhost ([127.0.0.1]:37657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSpiX-00036s-GP for submit@debbugs.gnu.org; Mon, 29 Oct 2012 09:49:25 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:3016) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSpiV-00036k-FJ for 12758@debbugs.gnu.org; Mon, 29 Oct 2012 09:49:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu0/O+LET/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLDiYSFBgNJIgcBboJkEQDozOBWIMF X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="203063653" Received: from 206-248-177-19.dsl.teksavvy.com (HELO ceviche.home) ([206.248.177.19]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 29 Oct 2012 09:46:56 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 836CE662A1; Mon, 29 Oct 2012 09:46:56 -0400 (EDT) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#12758: letf no longer allows unbound variables Message-ID: References: Date: Mon, 29 Oct 2012 09:46:56 -0400 In-Reply-To: (Glenn Morris's message of "Mon, 29 Oct 2012 03:42:28 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 12758 Cc: 12758@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: 0.8 (/) > Evaluating this returns `99', and leaves `b' unbound. This behaviour is > documented in cl.texi: > In most cases, the @var{place} must have a well-defined value on > entry to the @code{letf} form. The only exceptions are plain > variables and calls to @code{symbol-value} and @code{symbol-function}. > If the symbol is not bound on entry, it is simply made unbound by > @code{makunbound} or @code{fmakunbound} on exit. I think this was a bad idea, so it indeed doesn't work that way any longer; more specifically: - W.r.t symbol-function, this is still true for `letf' but not for `cl-letf'. - W.r.t symbol-value, this is not true any more neither of `letf' nor or `cl-letf' (I could change that for letf but in the absence of a bug-report pointing to pre-existing code that depends on this behavior I'd rather not). - For (letf ((b 4)) ...) this is still true, because it expands to (let ((b 4)) ...). But for (letf ((b)) ...) it isn't because that expands to (let ((b b)) ...). When `b' is a lexically-scoped variable, we really can't "fix" it because lexical variables don't have a notion of "unbound". Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 30 03:37:49 2012 Received: (at control) by debbugs.gnu.org; 30 Oct 2012 07:37:50 +0000 Received: from localhost ([127.0.0.1]:38862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TT6OT-0007Br-G1 for submit@debbugs.gnu.org; Tue, 30 Oct 2012 03:37:49 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:41507) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TT6OS-0007Bl-Bg for control@debbugs.gnu.org; Tue, 30 Oct 2012 03:37:48 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TT6M1-00016G-Tm for control@debbugs.gnu.org; Tue, 30 Oct 2012 03:35:17 -0400 Date: Tue, 30 Oct 2012 03:35:17 -0400 Message-Id: Subject: control message for bug 12758 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: control 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: -4.8 (----) tag 12758 wontfix close 12758 From unknown Tue Jun 24 06:54:39 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, 27 Nov 2012 12:24:03 +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