Hello,

Am 08.09.2008 um 20:37 schrieb noahr:

(defn tst[] (pr 4))

(defn trd[]
  (let [f #(eval '(tst))]
    (. (Thread. f) start) ))

The eval executes the code in the clojure namespace.  You have to fully
qualify your tst function. The easiest way to do this to use ` instead
of '. So using ` should make your example work.

I don't know, whether this is right or not. I noticed something similar
when executing a multimethod, which contained an eval. It was not eval'd
in the namespace of the defined multimethod.

With a bit more thought: One can defmulti a method in one namespace and
detmethod it in another via use. In which context should the code be
eval'd?

Again, this is probably a sign, which tells us to stay away from eval.

Sincerely
Meikel

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to