On Sat, Jan 23, 2010 at 7:43 PM, Richard Newman <holyg...@gmail.com> wrote:

> Use futures and promises for parallelism or dataflow-style work. Use delay
> for non-parallel, synchronous delayed execution.


You're right. Here's a recursive example of what I was trying to do with
promise/deliver:

http://gist.github.com/284957

And with delay/force:

http://gist.github.com/284972

I suppose the one thing I like about promise/deliver is that promises can be
"watched" making it perhaps more extensible? Anyone can get just attempt to
deref the value inside a future to "watch it". With delay/force it's harder
to add new functionality without mucking directly with the code. Or is there
a better way to handle this that I haven't thought of?

Thanks for the insights Richard.

-- 
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

Reply via email to