From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: Should letrec via syntax work within eval-when (expand load eval)? Date: Mon, 29 Jul 2019 20:57:38 -0500 Message-ID: <87lfwgl1wt.fsf@trouble.defaultvalue.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="248664"; mail-complaints-to="usenet@blaine.gmane.org" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jul 30 03:57:47 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hsHOc-0012ZB-N2 for guile-devel@m.gmane.org; Tue, 30 Jul 2019 03:57:46 +0200 Original-Received: from localhost ([::1]:57466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsHOb-00008b-LG for guile-devel@m.gmane.org; Mon, 29 Jul 2019 21:57:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43059) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsHOX-00008D-Ax for guile-devel@gnu.org; Mon, 29 Jul 2019 21:57:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsHOW-00016B-BD for guile-devel@gnu.org; Mon, 29 Jul 2019 21:57:41 -0400 Original-Received: from defaultvalue.org ([45.33.119.55]:38022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hsHOW-00015A-6V for guile-devel@gnu.org; Mon, 29 Jul 2019 21:57:40 -0400 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 1C70A2022B for ; Mon, 29 Jul 2019 20:57:39 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 5E59514E066; Mon, 29 Jul 2019 20:57:38 -0500 (CDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 45.33.119.55 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20025 Archived-At: I narrowed down an issue I'd hit to this: ;; somefile.scm (define-syntax foo (syntax-rules () ((_ any ...) (letrec ((x y) (y 'foo)) x)))) (eval-when (expand load eval) (foo 1)) Which produces this with 2.2.4 and 2.2.6: $ guile -s somefile.scm [...] Backtrace: 7 (primitive-load "/home/rlb/src/lokke/standalone/ele.scm") In ice-9/eval.scm: 721:20 6 (primitive-eval (eval-when (expand load eval) (foo 1))) In ice-9/psyntax.scm: 1235:36 5 (expand-top-sequence ((eval-when (expand load eval) #)) =E2= =80=A6) 1182:24 4 (parse _ (("placeholder" placeholder)) ((top) #(# # =E2=80= =A6)) =E2=80=A6) 285:10 3 (parse _ (("placeholder" placeholder)) ((top) #(# # =E2=80= =A6)) =E2=80=A6) In ice-9/eval.scm: 619:8 2 (_ #(# # =E2=80=A6)) 298:34 1 (_ #(# # =E2=80=A6)) 227:9 0 (_ _) ice-9/eval.scm:227:9: Unbound variable: #> but works fine without the eval-when, and I wondered if that was expected. Thanks --=20 Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4