From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: okamsn+emacs-help@protonmail.com Newsgroups: gmane.emacs.help Subject: Function value changes after running function? Date: Fri, 05 Feb 2021 02:41:27 +0000 Message-ID: Reply-To: okamsn+emacs-help@protonmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36001"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 05 03:42:05 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7r4P-0009I1-E2 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 03:42:05 +0100 Original-Received: from localhost ([::1]:53894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7r4O-0006wr-FZ for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 04 Feb 2021 21:42:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7r3z-0006uZ-SG for help-gnu-emacs@gnu.org; Thu, 04 Feb 2021 21:41:40 -0500 Original-Received: from mail2.protonmail.ch ([185.70.40.22]:20413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7r3x-0001vF-5o for help-gnu-emacs@gnu.org; Thu, 04 Feb 2021 21:41:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1612492891; bh=9gghGBlqsLmTw5kRJlRPImBogxGA8oiuCc0cPwVDh10=; h=Date:To:From:Reply-To:Subject:From; b=HC4asXbZeAb2NnzXj4XgO3+ZoMvaJ7+AB6syG4gXNP7krQEfOQ2j2VgkCl8/6rhMd 2STMepBoBE/sediV+yMyNGqGoWlECDbS+cSFwFWQuvdUg7J0mqk8OMGxzZe+nlMFlY ImGw1HpmsbiXOYPIJuNDHPe8AJAE7uqTkpOY5uFQ= Received-SPF: pass client-ip=185.70.40.22; envelope-from=okamsn+emacs-help@protonmail.com; helo=mail2.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127613 Archived-At: Hello, On Emacs 27.1, I've learned that a function using a macro I wrote raises=20 an error after running the function a second time. The function is (defun mu4e:other-path () "Return load-path for mu4e. This assumes that you're on guix." (loopy (with (regexp "Documents") =09 (base-dir (f-full "~/"))) =09 ((list file (directory-files base-dir)) =09 (expr full-path (f-expand file base-dir))))) and running it once from my home directory returns nil, as expected.=20 However, if run again, it raises an error *** Symbol=E2=80=99s value as variable is void: base-dir I've found after evaluating the function definition, `symbol-function'=20 reports the definition as (closure (t) nil "Return load-path for mu4e. This assumes that you're on guix." (loopy (with (regexp "Documents") (base-dir (f-full "~/"))) ((list file (directory-files base-dir)) (expr full-path (f-expand file base-dir))))) where `base-dir` is defined, but if I run it again, the function=20 definition is reported again as (closure (t) nil "Return load-path for mu4e. This assumes that you're on guix." (loopy (with (regexp "Documents")) ((list file (directory-files base-dir)) (expr full-path (f-expand file base-dir))))) where `base-dir` is no longer defined. Why would the function definition be changed after running the function?=20 Is that a known problem with macros, or with Emacs 27.1? I haven't=20 seen this on Emacs 28. Thank you.