guile-user
[Top][All Lists]
Advanced

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

Re: Problem with modules in Guile 2.0


From: Mark H Weaver
Subject: Re: Problem with modules in Guile 2.0
Date: Wed, 07 Mar 2012 15:11:42 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Gubinelli Massimiliano <address@hidden> 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



reply via email to

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