Hi Stuart,

> I spent a few minutes trying to write a macro to do this that doesn't  
> use eval. So far no good. Is it truly impossible, though? I have never  
> seen a good discussion of "things that can be done only with eval".  
> Any pointers?

The problem is, that macros happen at compile time, while a
Var holds a value at runtime. So when we write a macro à la

(defmacro my-let
  [bvec & body]
  `(let ~bvec [EMAIL PROTECTED]))

And call it as (my-let some-vec ...), then the macro does not
see the value of Var named some-vec, but the symbol some-vec
itself.

Hence, you need eval: you inject the value of some-vec and
*compile* the expression at *runtime*. (Maybe this is the
definition of when eval is needed...)

Hope, this makes sense.

Sincerely
Meikel


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to