Fork me on GitHub
#babashka
<
2019-12-09
>
borkdude15:12:43

@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"

borkdude15:12:51

there's also an unbound var in CLJS sci:

cljs.user=> (sci/eval-string "(def ^:dynamic x) x")
#object[sci.impl.vars.SciUnbound]

plexus15:12:51

good to know!

borkdude15:12:13

in practice it's a bit trivial though, there's still only one thread in CLJS

borkdude15:12:39

I started with the CLJS implementation and then made it work like CLJ

borkdude15:12:09

This was just merged to master last weekend

borkdude16:12:37

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.

borkdude16:12:36

and that should imo just work, but whatever, I'm not going to argue with them and will just roll my own thing

sogaiu16:12:33

what you say makes sense -- what they don't support is dynamic "class" loading. you want to load things that are not classes, right?

borkdude16:12:48

yes, I just want to detect a file in a collection of .jar files

sogaiu16:12:01

i think i'll comment on that issue