This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-25
Channels
- # aleph (6)
- # beginners (6)
- # boot (94)
- # cider (34)
- # cljs-dev (36)
- # cljsrn (12)
- # clojure (124)
- # clojure-dev (41)
- # clojure-dusseldorf (6)
- # clojure-italy (3)
- # clojure-norway (1)
- # clojure-russia (161)
- # clojure-sg (7)
- # clojure-spec (71)
- # clojure-uk (95)
- # clojurescript (38)
- # core-async (16)
- # cursive (14)
- # data-science (1)
- # datascript (12)
- # datomic (15)
- # emacs (22)
- # funcool (2)
- # hoplon (15)
- # jobs-rus (2)
- # juxt (9)
- # liberator (7)
- # lumo (1)
- # off-topic (136)
- # onyx (24)
- # pedestal (39)
- # perun (2)
- # planck (20)
- # re-frame (23)
- # spacemacs (31)
- # unrepl (5)
- # untangled (1)
- # vim (1)
- # yada (29)
Hi. Maybe a stupid question... Are with-redefs
and core.async
supposed to work well together in Clojure (not ClojureScript)?
Background: I wanted to use clj-http-fake to mock some HTTP requests that get done somewhere down the channels...
@bronsa thanks. Then I will try to work with with-fake-routes
instead of with-global-fake-routes
They are defined :dynamic
: https://github.com/myfreeweb/clj-http-fake/blob/master/src/clj_http/fake.clj#L12
@ska more info than you ever wanted to know about the "why" here: http://blog.cognitect.com/blog/2016/9/15/works-on-my-machine-understanding-var-bindings-and-roots
I enjoyed reading this article again, very informative. There is one error in the article though (as a comment at the bottom of the article mentions), that is in the critical part of understanding it: "root value has already been reset back to 0, causing a race condition" .. should be "reset back to 42".
@tbaldridge thanks for the pointer. Exactly what I was looking for. I always thought that with-redefs
is "stronger" than binding
but I did not think about the form having been exited on the main thread already, while the part of the program behind the channel does its thing. And the last time I looked closer (http://clojure-buch.de/html/master_develch2.html#x5-480002.7.4) the :dynamic
meta-data was not yet invented. 🙂