From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Compile in a fresh module by default Date: Wed, 14 Oct 2009 10:11:49 +0200 Message-ID: <87k4yy75tm.fsf@gnu.org> References: <87ws52i36r.fsf@gnu.org> <87ljk9i6d7.fsf@gnu.org> <2bc5f8210910131926w57224fb6t6231555585f59f51@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1255508188 25048 80.91.229.12 (14 Oct 2009 08:16:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Oct 2009 08:16:28 +0000 (UTC) Cc: guile-devel@gnu.org To: Julian Graham Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Oct 14 10:16:17 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mxz1q-0004Ix-GQ for guile-devel@m.gmane.org; Wed, 14 Oct 2009 10:16:14 +0200 Original-Received: from localhost ([127.0.0.1]:59186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxz1p-0000Ds-VG for guile-devel@m.gmane.org; Wed, 14 Oct 2009 04:16:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mxyxh-0005fz-Jf for guile-devel@gnu.org; Wed, 14 Oct 2009 04:11:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mxyxd-0005ba-UB for guile-devel@gnu.org; Wed, 14 Oct 2009 04:11:57 -0400 Original-Received: from [199.232.76.173] (port=43617 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxyxd-0005bN-Of for guile-devel@gnu.org; Wed, 14 Oct 2009 04:11:53 -0400 Original-Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:16582) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1Mxyxd-00089E-9o for guile-devel@gnu.org; Wed, 14 Oct 2009 04:11:53 -0400 X-IronPort-AV: E=Sophos;i="4.44,556,1249250400"; d="scan'208";a="34873883" Original-Received: from laptop-147-210-128-170.labri.fr (HELO nixey) ([147.210.128.170]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 14 Oct 2009 10:11:51 +0200 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 23 =?iso-8859-1?Q?Vend=E9miaire?= an 218 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <2bc5f8210910131926w57224fb6t6231555585f59f51@mail.gmail.com> (Julian Graham's message of "Tue, 13 Oct 2009 22:26:49 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9487 Archived-At: Hi Julian, Julian Graham writes: > Naive question (and I realize I'm a bit late here): What if there are > bindings in the current module that need to be present for expansion > and compilation to succeed? Just specify =E2=80=98(compile EXP #:env (current-module))=E2=80=99. This = is what =E2=80=98repl-compile=E2=80=99 in =E2=80=98(system repl common)=E2=80=99 do= es, so that one can define macros at the REPL and actually use them. > I ask because I'm working on a macro that transforms R6RS library > expressions, which contain nested `define' calls, into Guile modules. > My code rewrites these defines as location declarations that get > exported as part of a module interface (at least, in theory -- right > now it just erases them). Can you give an example of the macro transformation? > When I bind my `library' macro in the REPL after building from the > current HEAD of master and then load and compile a source file > containing an R6RS library form, I get a syncase error during > compilation about defines in expression context; when I revert the > effects of this patch, the error goes away. Can you post a simplified example that reproduces the problem? Thanks, Ludo=E2=80=99.