Hi all,

I''d like to have a macro like the following but preferably without the 'eval' inside the assertion form:

(defmacro defcomponent [name co]
 (assert (component? (eval co)) "Not a valid IComponent")
 `(def ~name ~co))

If I don't use eval, everything works as long as I pass a var in...However if I pass in something like (String. "jam") it is not being evaluated and thus is a list not an object...and it will never satisfy IComponent.

any thoughts?
thanks in advance :)

Jim


--
--
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