The difficulty with On Lisp when applied to Clojure is that the specific 
macros On Lisp demonstrates either depend on state, which Clojure avoids, 
or are already present in Clojure core. (if-let is a big one in my book.) 
Some of them also run into conflicts with Clojure implicit gensyming. I 
don't suggest it for the specific macros it demonstrates, but because it 
demonstrates very clearly what they are for, why and where you would use 
them, and how, in general, they are used. I also don't write macro much 
anymore in Clojure but that's mostly because Clojure has a few macros 
already which handle most of the things I would do with them in Common Lisp.

On Friday, August 9, 2013 11:13:44 AM UTC-4, Lee wrote:
>
>
> On Aug 9, 2013, at 11:01 AM, Andrew Stine wrote: 
>
> > For a pretty decent cover of when and how to use macros, On Lisp[1] is a 
> pretty good book. It's written mainly for Common Lisp but most of it 
> translates to Clojure well enough. I find that for common code, writing 
> macros isn't so useful as most of the goods ones are already part of 
> clojure.core. But if you ever find yourself in the position where you'd 
> really like to have a control structure just for your program, or introduce 
> a compile-time code generator, or subtly add a new paradigm to the 
> language, a macro is your ticket. 
> > 
> > 1. http://code.google.com/p/onlisp/ 
>
> I think that On Lisp is completely awesome -- one of the best technical 
> books of any kind that I've ever read. 
>
> However, my recollection is that the macro stuff, in particular, doesn't 
> translate so well to Clojure because the differences between Common Lisp 
> and Clojure macros are pretty fundamental. Or at least that has been my 
> impression.... and I mostly stopped writing macros when I switched from 
> Common Lisp to Clojure because I found the differences confusing. Your 
> experience may be different but I thought that a warning might be in order. 
>
>  -Lee 
>
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to