From: Mark H Weaver <mhw@netris.org>
To: Gubinelli Massimiliano <m.gubinelli@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Problem with modules in Guile 2.0
Date: Wed, 07 Mar 2012 15:11:42 -0500 [thread overview]
Message-ID: <87vcmguq69.fsf@netris.org> (raw)
In-Reply-To: <54183C89-DE93-417E-84EC-5C454E56EE35@gmail.com> (Gubinelli Massimiliano's message of "Tue, 6 Mar 2012 22:48:22 +0100")
Gubinelli Massimiliano <m.gubinelli@gmail.com> writes:
> I stumbled on a strange behaviour of Guile 2.0, I have the following three files: main.scm, test-module.scm and sub/mymodule.scm which respectively contain
>
> ---- main.scm
>
> (load "test-modules.scm")
>
> (inherit-modules (sub mymodule))
>
> (display (pippo 10 20)) (display "\n")
The problem is that 'load' is done only at run time, not compile time,
so the compiler does not have access to the macro 'inherit-modules'.
Since Guile 1.x did not have a compiler, this was not an issue.
One easy solution would be to use the 'include' macro instead.
'include' acts like '#include' in C: it splices the entire contents of
the included file in place of the 'include' form, at compilation time.
'include' did not exist in Guile 1.x, but you could do something like
this to make 'include' an alias for 'load' in Guile 1.x:
(cond-expand
(guile-2 #f)
(guile (define include load)))
Best,
Mark
next prev parent reply other threads:[~2012-03-07 20:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 21:48 Problem with modules in Guile 2.0 Gubinelli Massimiliano
2012-03-07 20:11 ` Mark H Weaver [this message]
2012-03-07 20:32 ` Andy Wingo
2012-03-07 22:52 ` Gubinelli Massimiliano
2012-03-08 2:01 ` Mark H Weaver
2012-03-09 0:03 ` Gubinelli Massimiliano
2012-03-09 16:29 ` Mark H Weaver
2012-03-10 0:33 ` Gubinelli Massimiliano
2012-03-11 20:38 ` Mark H Weaver
2012-03-13 1:10 ` Gubinelli Massimiliano
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=87vcmguq69.fsf@netris.org \
--to=mhw@netris.org \
--cc=guile-user@gnu.org \
--cc=m.gubinelli@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).