Gubinelli Massimiliano <m.gubine...@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