unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: David Kastrup <dak@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: Autocompilation/LilyPond
Date: Mon, 05 Mar 2012 21:36:33 -0500	[thread overview]
Message-ID: <87399mxxou.fsf@netris.org> (raw)
In-Reply-To: <87mx7uy1z6.fsf@fencepost.gnu.org> (David Kastrup's message of "Tue, 06 Mar 2012 02:03:57 +0100")

David Kastrup <dak@gnu.org> writes:

> Mark H Weaver <mhw@netris.org> writes:
>
>> Excellent!  As long as you load everything in the right order, such that
>> macros are defined before they are used, I don't see why there should be
>> any other problems related to macros and compilation.
>
> Because the individual files are not independent from one another?
> That's why I wrote:
>
>     Personally, I think it would make sense if we could get the
>     autocompiler to treat the whole blob of files as _one_ unit, and
>     recompile the unit if it gets out of date.

There's no problem with them being dependent on one another.  When you
load a file, even with auto-compilation, the macro expander will make
use of whatever macros are already bound in the current module.  The
rest of the compiler sees only the output of the macro expander.

Try the following experiment: put "(define-macro (bar x) `(quote ,x))"
into "foo1.scm", and "(define (foo x) (bar x))" into "foo2.scm", and
then within a REPL type: (load "foo1.scm") (load "foo2.scm") and observe
that everything works as it should.

If you really want everything to be compiled as one unit, you can use
'include' (which acts essentially the same as #include in C), though
beware that Guile is not yet smart enough to auto-recompile when one of
the included files gets updated.

I don't see any compelling benefit to compiling everything as one unit,
but do as you wish :)

   Regards,
     Mark



  reply	other threads:[~2012-03-06  2:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 10:27 Autocompilation/LilyPond David Kastrup
2012-03-05 13:45 ` Autocompilation/LilyPond Mark H Weaver
2012-03-05 14:39   ` Autocompilation/LilyPond David Kastrup
2012-03-05 17:57     ` Autocompilation/LilyPond Mark H Weaver
2012-03-06  1:03       ` Autocompilation/LilyPond David Kastrup
2012-03-06  2:36         ` Mark H Weaver [this message]
2012-03-07 23:51           ` Autocompilation/LilyPond David Kastrup
2012-03-09 16:19             ` Autocompilation/LilyPond Mark H Weaver
2012-03-09 16:55               ` Autocompilation/LilyPond David Kastrup
2012-03-09 18:57                 ` Autocompilation/LilyPond Mark H Weaver
2012-03-09 19:27                   ` Autocompilation/LilyPond David Kastrup
2012-03-10 12:24                     ` Autocompilation/LilyPond Ian Hulin
2012-03-10 13:05                       ` Autocompilation/LilyPond David Kastrup
2012-03-10 22:41 ` Autocompilation/LilyPond Ludovic Courtès
2012-03-10 23:15   ` Autocompilation/LilyPond David Kastrup
2012-03-16 11:12     ` Autocompilation/LilyPond 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=87399mxxou.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=dak@gnu.org \
    --cc=guile-devel@gnu.org \
    /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).