Hi all,
I was under the impression that I fully understood what
name-with-attributes does but I'm having a slight problem. I'm trying to
define macros like the following:
(defmacro defworkflow
"Defines a top-level Workflow with the specified name optionally
doc-string and attr-map on the var.
You can pass in an arbitrary number of valid Components and you'll get
back a Workflow object.
The var's doc-string will also be attached to the Workflow's metadata
under :description."
[name & args]
(let [[name attrs] (name-with-attributes name args)]
`(let [cs-coll# ~(vec attrs)]
(assert (every? component? cs-coll#) "Can only accept IComponents")
(def ~name (Workflow. cs-coll# {:description *(-> ~name meta :doc)*}
nil))) ))
Everything works just fine apart from the metadata on the object (not
the var). The var's doc-string is attached as expected but the
{:description ...} meta-map is not attached on the resulting object. In
other words doing (-> w meta :description) returns nil...Can anyone
enlighten me? I have a feeling it's something very simple...
many 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.