Hi,
Iam trying to run a function in a thread assuming that threads are
runnable, below is my program i want to print 4 time the current date
(defn- on-thread [f]
(doto (Thread. #^Runnable f)
(.start)))
(defn prnTime [] (prn (System/currentTimeMillis)))
(defn r4t [f]
(dotimes [n 4] (f)))
(r4t (on-thread (prnTime)))
iam getting this error what is wrong with this ?
java.lang.Thread cannot be cast to clojure.lang.IFn
Pls let me know what is wrong and how to make it run in 4 threads so
that i can see 4 time the system print to the screen
--
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