Hi William, Manifold deferreds can capture exceptions like future does.
http://aleph.io/manifold/deferreds.html On Sat, Aug 8, 2015 at 12:44 AM, William la Forge <[email protected]> wrote: > Still a newbie here, about to release my first Clojure project. But that > clojure blob will take some digging on my part. I use a gummed up > dereference function that checks for Throwable in the meantime. > > My goal right now is to become a Dtomic freelancer. So much to learn! > Which is why I'm doing projects. Only way I know to become proficient! So > yeah, I need to get to the point where I can roll my own. Similarly, my > first project builds on the send method, but I really need to get to the > point where I can roll my own agent. > > In any case, thanks Francis. I can only promise more dumb questions in the > future. ;-) > > > On Friday, August 7, 2015 at 5:24:24 PM UTC-4, Francis Avila wrote: >> >> Huh, I was sure I had done this before, but I misremembered, I was using >> my own promise that rethrew Throwable instances on deref (and it was in >> clojurescript!) >> >> Clojure promises have no notion of failure, only realized/not-realized. >> You need to deliver a sentinel type or value and check for it on deref, or >> implement your own promise type which does it for you. (It's not that hard: >> https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L6803 >> ) >> >> On Friday, August 7, 2015 at 4:09:39 PM UTC-5, William la Forge wrote: >>> >>> Sorry, I meant to ask how to fail with a promise? It seems that there is >>> no fail method. >>> >>> On Friday, August 7, 2015 at 4:52:47 PM UTC-4, Francis Avila wrote: >>>> >>>> Futures automatically capture exceptions raised in their bodies and >>>> reraise them when the future is derefed. Promises also throw exceptions >>>> when derefed. >>>> >>>> Unlike promises, futures are created with the code that delivers their >>>> value, so calling fail and deliver explicitly on a future makes no sense. >>>> >>>> Think of futures as a thin wrapper around a promise which spawns a >>>> thread, runs the code, and to the wrapped promise either delivers the >>>> result of the code or calls (fail private-promise raised-exception) for >>>> you. >>>> >>>> On Friday, August 7, 2015 at 2:14:30 PM UTC-5, William la Forge wrote: >>>>> >>>>> A future fails when it throws an exception. How to do that with a >>>>> future? >>>>> >>>>> It looks like (fail future exception) does not do the trick: >>>>> http://dev.clojure.org/display/design/Promises >>>>> >>>>> -- > 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/d/optout. > -- Kind Regards, Atamert Ölçgen ◻◼◻ ◻◻◼ ◼◼◼ www.muhuk.com -- 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/d/optout.
