HI all,
I've gotten myself into a weird situation...
I'm defining a def-like macro and I want to use 'name-with-attributes'.
Consider the following skeleton:
(defmacro defX [name & args]
(let [[name attrs] (name-with-attributes name args)]
`(let [cs-coll# ~attrs]
(assert (every? component? cs-coll#) "Can only accept IComponents")
(def ~name (Workflow. cs-coll# {:description (-> ~name meta :doc)}
nil)))
now consider that I am calling this like so:
(defworkflow my-stem-pipe "my own basic stemming pipe" my-ssplit
my-tokenizer porter-stemmer)
where the last three symbols refer to records which implement IFn...
doing "~attrs" tries to invoke the list as a function-call because the
first symbol happens to be a function but I just want the list of
records (eval'd symbols) so the assertion can proceed...
any ideas?
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.