This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-09
Channels
- # adventofcode (95)
- # announcements (22)
- # aws (2)
- # babashka (14)
- # beginners (133)
- # bristol-clojurians (2)
- # calva (43)
- # cider (11)
- # clj-kondo (82)
- # cljsrn (20)
- # clojure (100)
- # clojure-europe (12)
- # clojure-italy (9)
- # clojure-nl (7)
- # clojure-poland (1)
- # clojure-spec (4)
- # clojure-uk (105)
- # clojurescript (42)
- # cryogen (1)
- # cursive (6)
- # data-science (1)
- # datomic (5)
- # euroclojure (2)
- # figwheel (4)
- # fulcro (4)
- # garden (1)
- # graphql (3)
- # hoplon (4)
- # jobs (1)
- # joker (3)
- # luminus (4)
- # malli (15)
- # off-topic (129)
- # pathom (10)
- # re-frame (43)
- # reagent (7)
- # reitit (3)
- # shadow-cljs (31)
- # vim (6)
- # yada (39)
@plexus nice blog: https://lambdaisland.com/blog/2019-12-09-advent-of-parens-9-dynamic-vars-clojurescript Note that CLJS sci is more consistent with JVM Clojure 😉
cljs.user=> (sci/with-out-str (sci/eval-string "(def ^:dynamic x 1) (push-thread-bindings {#'x 2}) (prn x) (pop-thread-bindings)"))
"2\n"
there's also an unbound var in CLJS sci:
cljs.user=> (sci/eval-string "(def ^:dynamic x) x")
#object[sci.impl.vars.SciUnbound]
Here's the implementation: https://github.com/borkdude/sci/blob/master/src/sci/impl/vars.cljc
re: dynamically loading - here's what seems like an official reason: https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md#dynamic-class-loading--unloading
I can see their arguments for "the" JVM classpath. But I'm not using that. I'm just creating a one-off URLClassLoader to detect some files in some .jar files.
and that should imo just work, but whatever, I'm not going to argue with them and will just roll my own thing