<div>In fact I want to use the prelude option of the compiler inside the interpreted mode.</div><div>I have not seen any prelude: option in the compile-file function.</div><div><br></div><div>The command line I use actually in my Makefile</div>
<div>gsc-gambit -prelude '(include "test-macro.scm")' test-simple.scm</div><div><br></div><div><div> thanks<br><br><div class="gmail_quote">On Mon, May 7, 2012 at 3:33 PM, Bradley Lucier <span dir="ltr"><<a href="mailto:lucier@math.purdue.edu" target="_blank">lucier@math.purdue.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On May 7, 2012, at 10:11 PM, Cyrille Duret wrote:<br>
<br>
> mmm<br>
> seems that I will have to use Makefile instead of gsc -i<br>
> cyrille<br>
<br>
</div>You came to that conclusion from reading the mail list archives?<br>
<br>
The following works:<br>
<br>
First, give the correct definition of my-macro:<br>
<br>
[Bradley-Luciers-MacBook-Pro:~/crap] lucier% cat test-macro.scm<br>
(define-macro (my-macro x) `(+ ,x 1))<br>
<br>
Then, include the macro definitions in the file you want to compile:<br>
<br>
[Bradley-Luciers-MacBook-Pro:~/crap] lucier% cat test-simple.scm<br>
(include "test-macro.scm")<br>
<div class="im">(define my-func (lambda (x) (+ x (my-macro x))))<br>
<br>
</div>Then the following works just fine:<br>
<br>
[Bradley-Luciers-MacBook-Pro:~/crap] lucier% cat build.scm<br>
(compile-file "test-simple.scm")<br>
[Bradley-Luciers-MacBook-Pro:~/crap] lucier% gsc -i build.scm<br>
[Bradley-Luciers-MacBook-Pro:~/crap] lucier% gsi<br>
Gambit v4.6.5<br>
<br>
> (load "test-simple")<br>
"/Users/lucier/crap/test-simple.o1"<br>
> (my-func 2)<br>
5<br>
<br>
</blockquote></div><br></div></div>