From unknown Tue Jun 24 06:59:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12758: letf no longer allows unbound variables Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Oct 2012 07:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12758@debbugs.gnu.org X-Debbugs-Original-To: submit@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135149669827863 (code B ref -1); Mon, 29 Oct 2012 07:45:01 +0000 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 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-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 unknown Tue Jun 24 06:59:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12758: letf no longer allows unbound variables Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Oct 2012 13:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: 12758@debbugs.gnu.org Received: via spool by 12758-submit@debbugs.gnu.org id=B12758.135151856511961 (code B ref 12758); Mon, 29 Oct 2012 13:50:01 +0000 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 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-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