As I watched David Nolen's compelling core.async web client webinar 
(http://go.cognitect.com/core_async_webinar_recording) I started to wonder 
if CSP was not another metaphor for Cells (the spreadsheet being another, 
and in FRP we have a time series or stream or something).

So I went ahead and redid the ten examples as closely as possible* using 
Cells.

    https://github.com/kennytilton/async-webinar

The README may soon be expanded, but if I do it will just be a reformatting 
of the heavily annotated:

  
 https://github.com/kennytilton/async-webinar/blob/master/src/webinar/core.cljs

Along the way I concluded Cells is not CSP, unless by communicating we mean 
"broadcasting whether or not anyone is listening and to whoever is 
listening". But my annotations turned out to be decent documentation of 
Cells, including a new "gotcha" I encountered recently for the first time 
in twenty years of Cells (suggesting the artificial code examples are unuse 
cases, which we already knew). That brings me to the long-awaited asterisK.

* In examples 4&5 David motivates then fixes a case where a coder is misled 
by the simplicity of a "go" form and tries to put to a channel and then 
take that value in the next statement, ending up blocked forever. That 
cannot happen with Cells, so I coded up the Cells "gotcha":

   (if (or cell-a cell-b) ....)

Cell depedencies are decided after each invocation of a cell formula and 
include only those other cells actually read, so once cell-a is true there 
will be no dependency on cell-b, so only cell-a is "heard".

Final note: I have seen "callback hell" a couple of places now. I guess 
Cells is hiding that from me. I do recall using qooxdoo's "message" hack to 
great effect in the brief time I did clients without Cells.

-kt




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to