This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-26
Channels
- # adventofcode (2)
- # babashka (17)
- # babashka-sci-dev (4)
- # beginners (8)
- # chlorine-clover (4)
- # clj-kondo (18)
- # clj-on-windows (1)
- # clojure (11)
- # clojure-india (12)
- # clojure-nl (1)
- # clojure-spec (9)
- # clojure-uk (3)
- # clojurescript (9)
- # conjure (3)
- # events (1)
- # graalvm (6)
- # lsp (6)
- # meander (4)
- # music (2)
- # off-topic (10)
- # other-languages (9)
- # re-frame (2)
- # releases (1)
- # reveal (8)
- # sci (1)
- # tools-deps (6)
Hi everyone, Suppose I write a custom class loader ... how can I make my JVM to add this class loader to its hierarchy of classloaders ? (Also are there any special concerns I need to address while using Clojure compared to Java when setting custom class loaders ?) Thanks a lot ----- This is sort of a follow up question to this https://clojurians.slack.com/archives/C053AK3F9/p1640024375266700.
Hey. I don't if it helps but try https://github.com/lambdaisland/classpath and maybe read the corresponding article https://lambdaisland.com/blog/2021-08-25-classpath-is-a-lie. It explains how to add a dynamic classloader.
Thanks a lot @UL638RXE2
Can this be done in a better way?
(defn left-par? [par]
(condp = par
"(" true
"{" true
"[" true
"<" true
false))
Also, condp =
can be replaced with case
for compile-time constants.
(defn left-par? [par]
(case par
("(" "{" "[" "<") true
false))
It's not as useful in this particular case but definitely should be used in place of condp =
where possible.
Finally, in this particular case you might find String.contains
to be the best solution:
=> (.contains "[{<(" "(")
true