Hi,
I found that resolve does not work correctly (I guess) when it is
called from other thread than main:
e.g.
let define
(def zz 123)
and afterwords call:
(.start (new Thread #(println (resolve 'zz))))
for me it does not work (it returns nil)
Workaround is to write a kind of "super-resolve" that search the all
available namespaces:
(defn super-resolve [sym-exp]
(loop [all-namespaces (all-ns) ]
(let [current-namespace (first all-namespaces)]
(let [result (ns-resolve current-namespace sym-exp)]
(if (and (= result nil) (> (count
all-namespaces) 1))
(recur (rest all-namespaces))
result)))))
and now is OK:
(.start (new Thread #(println (super-resolve 'zz))))
The question is, however, whether the resolve shouldn't work in the
same manner as resolve?
What do you think?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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