<div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">Thank-you for raising this topic.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">> I don't understand well its macros (are completely different for me than CL macros).</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>Me neither. And I'm somewhat torn. The trade-off as I understand it is that CL-style macros are *much* easier to learn, but prone to aliasing while hygenic macros are technically superior because they compose better and you can't accidentally hit aliasing problems. But when it comes to learning, the advantages are reversed.<div>
<div><br></div><div>William Byrd, in this <a href="http://clojure.com/blog/2012/02/16/take5-william-byrd.html">2012 interview</a> with Michael Fogus, comments on some of these issues:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Clojure's macro system appears to me to be a kludge, trying to patch up Common Lisp's defmacro without going all the way to real hygienic macros. I don't mean to be overly critical--I'm not happy with the state of Scheme, either, which has not one but two hygienic macro systems, neither of which is ideal.<br>
</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">The more powerful Scheme macro system, syntax-case, gives the programmer the full power of Scheme at macro expansion time, along with the ability to "bend" hygiene when desired. Syntax-case is powerful enough to define Common Lisp's defmacro (and almost certainly powerful enough to define Clojure's defmacro as well). Unfortunately, syntax-caseis notoriously complicated. As far as I can tell, mastering syntax-case requires a mental model equivalent in complexity to the macro expander's implementation. As a result, Dan, Oleg, and I refuse to use syntax-case.<br>
</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">The other Scheme macro system, syntax-rules, is strictly less powerful than syntax-case, and can in fact be implemented in syntax-case. However, the mental model required to use syntax-rules is much simpler, as it is essentially a term-rewriting system with hygiene. For vanilla forms such as let, and, and or, syntax-rules works beautifully. For incredibly complicated macros, such as the match pattern matcher used in Kent Dybvig's compiler course at Indiana, the full power of syntax-case is probably required. For almost all other macros, it seems like a system with just a little more power than syntax-rules would be both sufficient and ideal. For example, often a macro writer wishes to concatenate two symbols--currently this requires using syntax-case, even if the rest of the macro is trivial.<br>
</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">If a hygienic macro system that hits the sweet spot between syntax-rules and syntax-caseis created, I hope it will be adopted by Schemers and Clojurers alike. A few steps in this direction include the Dylan macro system and Ryan Culpepper's syntax-parse. Also needed is a way to learn how to write non-trivial hygienic macros that doesn't involve earning a PhD in programming languages from Indiana or Northeastern.</blockquote>
<div><br></div><div>The Racket and Scheme inner circle say that hygienic macros are the future, but I wonder whether a worse-is-better argument can be mounted for CL and/or Clojure macros.<br></div><div><br></div><div>Personally, I only write Racket macros sparingly, but would like to develop my level of understanding of comfort.</div>
</div></div><div><br></div><div>What are some good ways to smooth out the learning curve?</div><div><br></div><div><br></div><div>Dan</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 22, 2014 at 12:42 AM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Welcome.<br>
<br>
Why don't you take a look at Greg's macro write-up<br>
<br>
<a href="http://www.greghendershott.com/fear-of-macros/" target="_blank">http://www.greghendershott.com/fear-of-macros/</a><br>
<br>
and see whether this helps you wrap your head around macros.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
On Mar 21, 2014, at 9:48 AM, Alejandro Zamora Fonseca <<a href="mailto:terefv@ltu.sld.cu">terefv@ltu.sld.cu</a>> wrote:<br>
<br>
> Hi!!<br>
> My name is<br>
> Alejandro, i'm a Cuban Computer Scientist, new to Lisp(having 1 year using CL), and wishing change to Racket.<br>
> I see the list and I hope make me a better Lisp programmer with your kindly help.<br>
><br>
> I have Racket installed in my PC, I like the language and tools, but yet I don't understand well its macros(are completely different for me than CL macros) and continuations.<br>
><br>
> Greetings for all.<br>
><br>
> Alejandro<br>
><br>
><br>
><br>
><br>
> --<br>
><br>
> Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas<br>
><br>
> Infomed: <a href="http://www.sld.cu/" target="_blank">http://www.sld.cu/</a><br>
><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div style="font-family:arial;font-size:small"><b>Daniel Prager</b></div><div style="font-family:arial;font-size:small">Agile/Lean Coaching, Software Development and Leadership<br>
</div><div style="font-family:arial;font-size:small"><font color="#999999">Startup: </font><font color="#000000"><a href="http://www.youpatch.com" target="_blank">www.youpatch.com</a></font></div><div style="font-family:arial;font-size:small">
<font color="#999999">Twitter:</font> <a href="https://twitter.com/agilejitsu" style="color:rgb(17,85,204)" target="_blank">@agilejitsu</a> </div><div style="font-family:arial;font-size:small"><font color="#999999">Blog:</font> <a href="http://agile-jitsu.blogspot.com/" style="color:rgb(17,85,204)" target="_blank">agile-jitsu.blogspot.com</a></div>
</div>
</div>