unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Julian Graham <joolean@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Compile in a fresh module by default
Date: Wed, 14 Oct 2009 10:11:49 +0200	[thread overview]
Message-ID: <87k4yy75tm.fsf@gnu.org> (raw)
In-Reply-To: <2bc5f8210910131926w57224fb6t6231555585f59f51@mail.gmail.com> (Julian Graham's message of "Tue, 13 Oct 2009 22:26:49 -0400")

Hi Julian,

Julian Graham <joolean@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	other threads:[~2009-10-14  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 20:41 [PATCH] Compile in a fresh module by default Ludovic Courtès
2009-09-20 22:44 ` Ludovic Courtès
2009-10-14  2:26   ` Julian Graham
2009-10-14  8:11     ` Ludovic Courtès [this message]
2009-10-15  9:42       ` Andy Wingo
2009-10-15 11:51         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4yy75tm.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=joolean@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).