Fork me on GitHub
#core-async
<
2017-08-01
>
isaac02:08:59

In cljs, The outer binding has no affect for go’s body, it’s no like clojure:

clojurescript
(def ^:dynamic *foo* 3)
(binding [*foo* 42] (go (println *foo*)))
;;=> will print 3 instead of 42

tbaldridge04:08:36

bindings are pretty much a hack in CLJS

tbaldridge04:08:02

there's no global var registry, and so there's now way to grab vars and save them off during a call to async/go

tbaldridge04:08:42

@isaac so yes it's a known issue, probably won't be fixed soon.

isaac04:08:21

Yeah, It need improves both cljs & core.async

isaac04:08:20

currently, I use my extended async/go and use my self binding form , 🙂

tbaldridge04:08:47

how do you do that?

tbaldridge04:08:59

as in what are the mechanics in play?

isaac06:08:41

As you say, I use an atom as global registry

isaac06:08:50

And need mark :export meta for :dynamic var, prevent uglify for :advanced compile. then async/go can dynamic binding according the global registry.

janvanryswyck08:08:15

Practical question: I would like to buy the "Communicating Sequential Processes with core.async" course (http://shop.oreilly.com/product/0636920041474.do). I was wondering how I could purchase it without buying a year long Safari subscription or going through the evils of Udemy?