I notice it happens on Clojure 1.5.0-master-SNAPSHOT also. Calling something like: (future-cancelled? f) *true* before getting @f makes sense, but since I'm a clojure newb I don't know what showing "f" (not @f) would show. Maybe it should show something like: #<core$future_call$reify__3499@7c9391d9: :cancelled> and only @f should throw. That would make some sense to me. And it would make me understand what you wanted. But it appears as if it's trying to also show @f or maybe only show @f instead of the ":cancelled" part, as it does when the future is "future-done?"
On Thu, Oct 11, 2012 at 4:46 PM, Dave Ray <dave...@gmail.com> wrote: > In Clojure 1.4, I came across the following this week: > > user=> (def f (future (Thread/sleep 20000))) > #'user/f > user=> f > #<core$future_call$reify__6110@27adc5f7: :pending> > user=> (future-cancel f) > true > user=> f > CancellationException java.util.concurrent.FutureTask$Sync.innerGet > (FutureTask.java:220) > > That is, when printing a future, the cancellation state isn't checked for > resulting in an exception when Future.get() is called. It's more annoying > when the future is part of a larger data structure. > > Cheers, > > Dave > > > -- > 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 > Note that posts from new members are moderated - please be patient with > your first post. > 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 -- 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 Note that posts from new members are moderated - please be patient with your first post. 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