From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "pelzflorian (Florian Pelz)" Newsgroups: gmane.lisp.guile.user Subject: How to use-modules within macro? Date: Thu, 29 Aug 2019 16:41:44 +0200 Message-ID: <20190829144144.lsstoykbj3xigjua@pelzflorian.localdomain> 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="131467"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Aug 29 16:43:26 2019 Return-path: Envelope-to: guile-user@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 1i3Le2-000Y5Z-3K for guile-user@m.gmane.org; Thu, 29 Aug 2019 16:43:26 +0200 Original-Received: from localhost ([::1]:50576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3Le1-0005Vr-1V for guile-user@m.gmane.org; Thu, 29 Aug 2019 10:43:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42956) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3LcS-0004eH-Hr for guile-user@gnu.org; Thu, 29 Aug 2019 10:41:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i3LcR-0001e2-Is for guile-user@gnu.org; Thu, 29 Aug 2019 10:41:48 -0400 Original-Received: from pelzflorian.de ([5.45.111.108]:38054 helo=mail.pelzflorian.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i3LcR-0001cB-3v for guile-user@gnu.org; Thu, 29 Aug 2019 10:41:47 -0400 Original-Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 9F6EE3600E9 for ; Thu, 29 Aug 2019 16:41:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1567089704; bh=QrvsWLCgZdM4bH979MCCn7hQDC3gZZD0wME0rgshejY=; h=Date:From:To:Subject; b=No01pqw6IV/v6ioubfspbRh9oxvVW743iWHhzQV6oTjuMAHbsGSaqRhbFiAnUZgE7 v8PZ9dD+VZEirHnp2UtRsmFvsTAXj2Ufb9HrVrG6W8GaaZLEyhVPp3LF5CyHIi2UXj ZcwmY/+yRoMAM90Aai9tPcr4SfmKZPGPZuQz8p8A= Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 5.45.111.108 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15687 Archived-At: Hello, I am writing a Guile macro to manipulate Scheme code and am stuck on what I hope is a simple problem and it would be nice if you could explain. I try: (define-syntax O (lambda (x) (syntax-case x () ((_) #`(begin (use-modules (ice-9 local-eval)) (local-eval 42 (the-environment))))))) (pk (O)) But it does not work; it cannot resolve local-eval and the-environment. Why? When I write it in the interpreter, a second call to (pk=C2=A0(O)) works and prints 42. Using (@ (ice-9 local-eval) =E2=80=A6) does not work for looking up the-environment. Regards, Florian