guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Compile in a fresh module by default


From: Ludovic Courtès
Subject: Re: [PATCH] Compile in a fresh module by default
Date: Wed, 14 Oct 2009 10:11:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi Julian,

Julian Graham <address@hidden> 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 ‘(compile EXP #:env (current-module))’.  This is what
‘repl-compile’ in ‘(system repl common)’ does, 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’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]