Hi Julian,

Julian Graham <jool...@gmail.com> 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