Re: Macro Implementation: I Don't Understand This Error Message

2010-10-03 Thread Eivind Magnus Hvidevold
I'm not sure where I picked it up, but I remembered the arguments being called &form and &env, and googling for "clojure &form &env" led me to: http://groups.google.com/group/clojure/browse_thread/thread/d710c290b67951a3/b827d46389110f26?lnk=gst&q=clojure+macro+%26env#b827d46389110f26 : "&form con

Re: Macro Implementation: I Don't Understand This Error Message

2010-10-01 Thread Stefan Rohlfing
@Jürgen and Chris Thank you very much for helping me enlarge my understanding of macros! I realize that learning the subtleties of a macro implementation is not easy but well worth the effort. It is also quite interesting that a macro as it seems takes two implicit extra arguments. I am curious

Re: Macro Implementation: I Don't Understand This Error Message

2010-10-01 Thread Chris Perkins
On Oct 1, 3:59 am, Stefan Rohlfing wrote: > I wanted to expand the 'infix' macro presented in chapter 7.3.1 of > 'Clojure in Action' to handle nested s-expressions: > > My first version did not work: > > (defmacro my-infix [expr] >   (if (coll? expr) >     (let [ [left op right] expr] >       (lis

Re: Macro Implementation: I Don't Understand This Error Message

2010-10-01 Thread Jürgen Hötzel
2010/10/1 Stefan Rohlfing : > Dear Clojure Group, > > I wanted to expand the 'infix' macro presented in chapter 7.3.1 of > 'Clojure in Action' to handle nested s-expressions: > > My first version did not work: > > (defmacro my-infix [expr] >  (if (coll? expr) >    (let [ [left op right] expr] >    

Macro Implementation: I Don't Understand This Error Message

2010-10-01 Thread Stefan Rohlfing
Dear Clojure Group, I wanted to expand the 'infix' macro presented in chapter 7.3.1 of 'Clojure in Action' to handle nested s-expressions: My first version did not work: (defmacro my-infix [expr] (if (coll? expr) (let [ [left op right] expr] (list op (my-infix left) (my-infix right))