<p>Try (include "y.scm").</p>
<p>Rationale: In Gambit, syntax definitions are not visible across compilation-unit boundaries; each .scm file is a single compilation unit. However the INCLUDE form copies the text of the included file verbatim into the current compilation unit -- just like C #include -- so, much like C, you will want to factor out your syntax definitions into a separate "header file" and INCLUDE them where needed.</p>

<div class="gmail_quote">On Jan 16, 2012 1:35 PM, "Sascha Ziemann" <<a href="mailto:ceving@gmail.com">ceving@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have a problem loading a file which defines syntax. It does not work<br>
in Gambit although it works in other Schemes.<br>
<br>
This is file x.scm:<br>
<br>
(define-syntax x<br>
  (syntax-rules ()<br>
    ((_) (display "x\n"))))<br>
(load "y.scm")<br>
(x)<br>
(y)<br>
<br>
And this is y.scm:<br>
<br>
(define-syntax y<br>
  (syntax-rules ()<br>
    ((_) (display "y\n"))))<br>
<br>
When I run Gambit I get an error:<br>
<br>
$ gsi -:s x.scm<br>
x<br>
*** ERROR IN "x.scm"@8.2 -- Unbound variable: y<br>
<br>
But this works in Gauche, Bigloo and Chicken:<br>
<br>
$ gosh x.scm<br>
x<br>
y<br>
<br>
$ bigloo -s -i x.scm<br>
x<br>
y<br>
<br>
$ csi -qb x.scm<br>
x<br>
y<br>
<br>
Who is right?<br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</blockquote></div>