it seems to me to be like the case of global versus local variable<br>for passing parameters...<br><br>thanks for your help P!<br><br><br><div class="gmail_quote">On Tue, Aug 25, 2009 at 3:58 PM, Adrien Piérard <span dir="ltr"><<a href="mailto:pierarda@iro.umontreal.ca">pierarda@iro.umontreal.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">2009/8/25 antonitio <<a href="mailto:antonitio@gmail.com">antonitio@gmail.com</a>>:<br>

</div>> it works now!<br>
<br>
Great!<br>
Though, to remind you,<br>
having (load "~~lib/define-syntax") in the file that uses it will not<br>
work (because it mixes runtime and macroexpansion)<br>
You may have to do<br>
gsi -e '(load "~~lib/define-syntax")' your-file-with-macros.scm<br>
<div class="im"><br>
> i didn't know that there's a gambit expansion define-macro<br>
> (thanks adrien for pointing this out :-)<br>
<br>
</div>Since you *will* have bugs if this is your first time with<br>
define-macro, I also remind you that you can do<br>
gsc -expansion file-with-define-macro-s-used.scm<br>
to see what the expanded code looks like.<br>
<div class="im"><br>
> why using define-macro instead of define-syntax since<br>
> define-syntax is define in the standard (hence more portable)<br>
> even though some implementations also have define-macro?<br>
> is there any advantage of using define-macro? less code?<br>
> common-lisp-like?<br>
<br>
</div>Well, there is much to debate about this, but you first have to<br>
compare syntax-rules (which is hygienic and simple) and syntax-case<br>
(which I happen to not know at all for I never felt the need to use<br>
it).<br>
Define-macro allows me to *easily* share state between different macro<br>
expansions, to write macros that write macros (that write macros…),<br>
and to mask/rebind symbols that are defined in the context calling the<br>
macro. I am pretty sure you can do that with syntax-case too, but as I<br>
said, I am ill at ease with it.<br>
<br>
I let those who use syntax-case make the case (sic) clearer and<br>
enlighten both of us.<br>
<br>
P!<br>
<font color="#888888"><br>
--<br>
Français, English, 日本語, 한국어<br>
</font></blockquote></div><br>