This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-30
Channels
- # admin-announcements (1)
- # aws (32)
- # bangalore-clj (1)
- # beginners (2)
- # boot (137)
- # cider (2)
- # clara (1)
- # cljs-dev (39)
- # cljsrn (20)
- # clojure (268)
- # clojure-berlin (20)
- # clojure-canada (37)
- # clojure-dev (8)
- # clojure-gamedev (6)
- # clojure-norway (2)
- # clojure-russia (55)
- # clojure-spec (130)
- # clojure-uk (39)
- # clojurebridge (1)
- # clojurescript (102)
- # cursive (20)
- # datomic (231)
- # editors (5)
- # editors-rus (8)
- # events (5)
- # funcool (12)
- # hoplon (31)
- # instaparse (57)
- # jobs (9)
- # lein-figwheel (4)
- # off-topic (2)
- # om (8)
- # om-next (30)
- # onyx (241)
- # planck (6)
- # protorepl (4)
- # re-frame (115)
- # reagent (7)
- # rum (9)
- # schema (1)
- # test-check (9)
- # untangled (24)
- # yada (20)
@flyboarder what's the purpose of the let
in the config macro?
1. is it just for more concise/uniform reference in the body?
2. is it because evaluation is sequential in lets?
3. there is some other semantic/scoping issue it solves vs using the dynamic vars directly?
https://github.com/flyboarder/blaze/blob/master/src/blaze/core.clj#L22-L46
@flyboarder im also trying to run blaze again but it can't find material-hl
.
i've cloned
but it's only version 0.2.0-SNAPSHOT
i see i should do boot develop
to increment the minor, but that would still only be 0.3.0-SNAPSHOT
so i guess im missing some commits
@onetom I'll push a new version of material-hl today, iv fixed a bunch on stuff in it the last few days
@onetom: in regards to the let in config, this lets you set up binding and refer to it locally, which lets you use the bindings in things like click handlers and other things which require cross thread access to the bindings
I also updated the demo to the latest build: https://blaze-demo-23f77.firebaseapp.com/#
so, if i would just use the dynamic vars in click handlers then it would be possible that by the time i click on it, the binding has already changed?
config
is just smart sugar around binding
And let
You have to think of bindings as a pass over the form, click handlers and things in *-tpl
macros have their own pass
i understood what config
is, i just cant exactly imagine how the bindings could be changed in a way from outside of the binding
block that would affect code within the binding
expression.
in clojure itself i might be able to imagine since it has real threads, but in js, im not sure it can really happen
The main problem I run into is that when code is executed as a callback it usually doesn't have the bindings
when you do (binding [*foo* 100] (prn *foo*))
what really happens is someting like this:
@flyboarder i can imagine your problematic callback function was referring to a dynamic var, BUT the function itself was created outside of the desired (binding ...)
expression
You'd need to use bound-fn
But I like using #