Re: How to write a macro that writes another macro?

2009-08-12 Thread Rock
I've read what he has to say about backquotes, but he really doesn't give as clear and concise a method for figuring out what's going on as Graham does. To evaluate a backquoted expression, you remove the outermost backquote and each matching ~, and replace the expression following each matching

Re: How to write a macro that writes another macro?

2009-08-11 Thread Jonathan Smith
For the sake of contradicting myself, in this paper Alan Bawden explains quasi-quote much better than I can. https://eprints.kfupm.edu.sa/60346/1/60346.pdf Note the explanation towards the end of defmacro and constructs such as ',' (in clojure I believe it would be '~' ) Also note that Clojure

Re: How to write a macro that writes another macro?

2009-08-11 Thread Rock
For nested backquotes, Paul Graham in ANSI Common Lisp gives the clearest explanation. He makes it look almost trivial. As a matter of fact, once you get the hang of it, it's not at all that complicated. I've pretty much verified that what he says concerning CL backquotes applies perfectly to

Re: How to write a macro that writes another macro?

2009-08-11 Thread rob
Let Over Lambda by Hoyte contains a very lucidly well-written discussion of quotation levels in macros. It also includes a pretty useful technique for being explicit about variable capture. The code is in Common Lisp, but will mostly only differ syntactically from the Clojure code (for the

How to write a macro that writes another macro?

2009-08-10 Thread Dragan Djuric
For example: (defmacro creator [param] `(defmacro created [p] `(the code...)) ;; note the nested quote... how to resolve that? any examples? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: How to write a macro that writes another macro?

2009-08-10 Thread Jonathan Smith
On Aug 10, 3:20 pm, Dragan Djuric draga...@gmail.com wrote: For example: (defmacro creator [param]  `(defmacro created [p] `(the code...)) ;; note the nested quote... how to resolve that? any examples? Although I wouldn't cite my own code as a necessarily *good* or easy to understand