<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>You may wish to read this write-up on the Racket blog:&nbsp;</div><div><br></div><div>&nbsp;<a href="http://blog.racket-lang.org/2011/04/writing-syntax-case-macros.html">http://blog.racket-lang.org/2011/04/writing-syntax-case-macros.html</a></div><div><br></div><div><br></div><div><br></div><br><div><div>On Jul 14, 2011, at 8:58 AM, Markku Rontu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Thomas,<br><br>Thanks, this is a very interesting topic to me, and I'm glad someone "did bite" :)<br><br><div class="gmail_quote">On Thu, Jul 14, 2011 at 2:35 PM, Thomas Chust <span dir="ltr">&lt;<a href="mailto:chust@web.de">chust@web.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Markku Rontu wrote:<br>
&gt; [...]<br>
<div class="im">&gt; On the topic of macros, I find it a bit confusing that to metaprogram in<br>
&gt; Racket, I must use such a different language of macros (with<br>
&gt; syntax-rules et al.), instead of being able to manipulate common data<br>
&gt; structures with plain old Racket functions.<br>
</div>&gt; [...]<br>
<br>
Hello,<br>
<br>
this is not really true. The domain specific languages of syntax-rules<br>
and syntax-case macro transformers exist purely for your convenience.<br>
You can always manipulate syntax objects directly, all the necessary<br>
procedures are available and documented in section 11 of the Racket<br>
reference manual.<br>
<br></blockquote><div>&nbsp;</div><div>I'm sure the section 11 does go through the relevant issues, but doesn't feel like a good introduction to the matter. I can theorise that I can manipulate these syntax objects with plain old functions but nowhere does it seem to show a complete useful case. What I'm missing is an example that contains all the bits but that is not as complicated like the Racket sources themselves. Maybe I just didn't find it?<br>
&nbsp;</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
&gt; [...]<br>
<div class="im">&gt; The approach in Clojure,<br>
&gt; that the code is just a common data structure, easily manipulatable with<br>
&gt; Clojure code, is intriguing.<br>
</div>&gt; [...]<br>
<br>
The approach taken by Clojure and Common Lisp looks simple but lacks<br>
support for hygienic macros and is therefore error prone and actually<br>
not at all simple, if not impossible, to use correctly.<br>
<br></blockquote><div><br>It's simple, it's been explained countless times, it works in many cases. This thread started because this kind of an approach was used. It happens. So where to point people to learn "do it right"? Like I said, using syntax-rules makes the macro code look awfully complicated to me unless it's simple pattern matching. So where to go to the next level?<br>
</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
While Clojure *mitigates* the problems of non-hygienic macros using<br>
namespaces and a shorthand syntax for freshly generated identifiers, it<br>
doesn't *solve* the problems. Racket's macro system, on the other hand,<br>
does solve the problems and since that involves some heavy lifting, it<br>
may seem more complicated at first glance.<br>
<br></blockquote><div><br>I think, to advertise that Racket has the most advanced macro system, requires some additional educational material in the form of tutorials on more things than just the old syntax-rules et al. I think Clojure &amp; CL macros have appeal because they are trivial to explain and have been explained countless times already. Some piece is still missing from Racket side. Ok, there are technical manuals and papers but what about some hands-on articles? The material about going from the basic, old traditional macros to the Racket macros and syntax is not there or it's not found easily.<br>
<br>I'm sure everybody is busy on their own pet problems, extolling the virtues of Racket to the world may sometimes have to wait. Take this rant as a encouragement to spend some time educating people like me :)<br><br>
-Markku<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Ciao,<br>
Thomas<br>
<font color="#888888"><br>
<br>
--<br>
When C++ is your hammer, every problem looks like your thumb.<br>
</font></blockquote></div><br>
_________________________________________________<br> &nbsp;For list-related administrative tasks:<br> &nbsp;<a href="http://lists.racket-lang.org/listinfo/users">http://lists.racket-lang.org/listinfo/users</a></blockquote></div><br></body></html>