There is an example in the book The Joy of Clojure on p.262 that uses
futures that I evaluated in the REPL.
user> (time
(let [x (future (do (Thread/sleep 2000)
(+ 1 1)))]
[@x @x]))
"Elapsed time: 2000.809 msecs"
[2 2]
I figured that taking out the future would cause the execution to take
twice as long, however, when I try this:
user> (time
(let [x (do (Thread/sleep 2000)
(+ 1 1))]
[x x]))
"Elapsed time: 2000.512 msecs"
[2 2]
as you see it takes about the same amount of time. Does this have something
to do with the REPL evaluating things or maybe the newer version of Clojure
handles things differently from the Joy of Clojure book?
Thanks
--
--
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
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.