On Mar 26, 6:24 pm, mikel <mev...@mac.com> wrote:
> How would you write bound?
(defmacro bound? [nm & [the-ns]]
`(let [nm-nsname# (namespace '~nm)
the-ns# (if nm-nsname#
(find-ns (symbol nm-nsname#))
(or ~the-ns ~clojure.core/*ns*))
nm# (symbol (name '~nm))]
(if (contains? (ns-map the-ns#) nm#)
(if (var? (get (ns-map the-ns#) nm#))
(.isBound (get (ns-map the-ns#) nm#))
false)
false)))
Thanks to Stephen Gilardi for the suggestions.
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---