<br><br><div class="gmail_quote">On Sat, Aug 15, 2009 at 12:43 AM, 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">> Isn't one of the core tenents of define-macro that it's just lisp code<br>
> generating lisp code?<br>
<br>
</div>For what kind of lisp code?<br>
Gambit-specific code? Larceny-specific code? Just R4RS-specific code?<br>
Is it portable?<br>
<br>
What define-macro allows is implementation specific, but the bare<br>
minimum might not even be full R4RS compliant…<br>
<div class="im"><br>
> You most definitely did. I don't think I quite understand it yet.<br>
<br>
</div>Read it again ^^<br>
<div class="im"><br>
<br>
>> And also, you *want* a different environment than the runtime one…<br>
> Why? If I want to avoid naming clash, I can just put them in different<br>
> namespaces.<br>
<br>
</div>Err, namespaces are *not* even in R5RS. How would you then expect<br>
macro to work in previous versions of Scheme ?<br>
<br>
Moreover, with a common namespace, what would happen to such code?<br>
<br>
(define-macro (foo)<br>
  (define + (lambda (x y) 42))<br>
  (pp "foo"))<br>
<br>
(foo)<br>
(pp (+ 1 2)) ;; 42 !!!!!!!!!!!!!!<br>
<br>
You would not like that would you?<br>
<br>
Consider that,<br>
"A macro is an external program with takes a scheme source and returns<br>
a scheme source",<br>
then "A macro is an external program",<br>
then you do not want the variables defined in an external program to<br>
mask thoses of the processed data, do you?<br>
It's not even a matter of namespace. It's two different worlds.<br>
The names defined in your OS do not influence the results of the<br>
programs you write. Yet, your OS is handling your source code as a<br>
(dummy) macro would do.<br>
<br>
Please read Queinnec's book. Or write your own macro expanser.</blockquote><div> </div><div>A bit unrelated, but thanks for recommending that book. I just picked up a copy yesterday. It looks really good.<br><br> </div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<div><div></div><div class="h5"><br>
P!<br>
<br>
--<br>
Français, English, 日本語, 한국어<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>
</div></div></blockquote></div><br>