I try to build some basic script wich use external macro with -i switch from gsc and I encounter an annoying error.
@ ll
total 6
-rw-r--r-- 1 cydu cydu 60 May 5 10:36 build.scm
-rw-r--r-- 1 cydu cydu 39 May 5 10:36 test-macro.scm
-rw-r--r-- 1 cydu cydu 55 May 5 10:36 test-simple.scm
@ more test-macro.scm
(define-macro (my-macro x)
`(+ x 1))
@ more test-simple.scm
(define my-func
(lambda (x)
(+ x (my-macro x))))
@ more build.scm
(include "test-macro.scm")
(compile-file "test-simple.scm")
@ gsc-gambit -i build.scm
@ gsi-gambit
Gambit v4.6.4
> (load "test-simple")
*** WARNING -- Variable "my-macro" used in module "test-simple.o1" is undefined
"/usr/users/cydu/tmp/bug-test/test-simple.o1"
>
*** EOF again to exit
@ rm test-simple.o1
@ gsc-gambit
Gambit v4.6.4
> (include "test-macro.scm")
> (compile-file "test-simple.scm")
"/usr/users/cydu/tmp/bug-test/test-simple.o1"
>
*** EOF again to exit
@ gsi-gambit
Gambit v4.6.4
> (load "test-simple")
"/usr/users/cydu/tmp/bug-test/test-simple.o1"
> (my-func 3)
7
>
It fails from the i switch and succeed when I launch gsc and type the commands by myself.
It seems that the -i switch from gsc does not load the macro when it compile my file.