This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-23
Channels
- # announcements (2)
- # babashka (25)
- # beginners (33)
- # biff (13)
- # calva (13)
- # clerk (82)
- # clj-commons (3)
- # clj-kondo (8)
- # clj-on-windows (23)
- # cljdoc (6)
- # clojure (16)
- # clojure-belgium (1)
- # clojure-dev (58)
- # clojure-europe (53)
- # clojure-nl (1)
- # clojure-norway (15)
- # clojure-uk (2)
- # clojurescript (17)
- # core-async (5)
- # cursive (6)
- # datahike (1)
- # datomic (8)
- # emacs (25)
- # etaoin (21)
- # events (4)
- # graalvm (33)
- # honeysql (7)
- # hyperfiddle (1)
- # lsp (49)
- # luminus (4)
- # malli (18)
- # off-topic (63)
- # reagent (11)
- # releases (1)
- # shadow-cljs (200)
- # timbre (1)
- # tools-build (17)
Is there a way to safely look up some crazy nested structure like this without having to be overly verbose ?
(first (vals (first (vals (ffirst (vals (:_source (first (:hits (:hits (:display val))))))))))
Somehting instead of having to do
(if
(and
(:display val)
(:hits (:display val))
(:hits (:hits (:display val))
(first (:hits (:hits (:display val))))
I remembered the same answer from @U0NCTKEV8 some weeks back in #beginners: https://clojurians.slack.com/archives/C053AK3F9/p1675909214158479?thread_ts=1675905862.565029&cid=C053AK3F9
Back then I tried to solve the question with for (I wasn't the OP there), but couldn't and left it. After seeing the same answer again I searched for other times when @U0NCTKEV8 answered with "use for" and I found one occurrence from 2017, and some posts farther down this example, in case any other beginner's curious what "use for" looks like in practice (but was a different problem than the OP asked here): https://clojurians.slack.com/archives/C03S1KBA2/p1509568612000206
I am new to deps.edn
, how do I find out what library includes a transitive dependency? Specifically, I want to find out what library/ies include/s ch.qos.logback/logback-core
Thanks! I found it and it is a transitive dependency at least a couple of libraries "down".
luminus-immutant/luminus-immutant 0.2.5
. org.immutant/web 2.1.10
. org.immutant/core 2.1.10
. org.clojure/java.classpath 0.2.3
X org.clojure/tools.reader 0.10.0 :use-top
. org.projectodd.wunderboss/wunderboss-clojure 0.13.1
. org.projectodd.wunderboss/wunderboss-web-undertow 0.13.1
. org.projectodd.wunderboss/wunderboss-core 0.13.1
. ch.qos.logback/logback-classic 1.1.3
. ch.qos.logback/logback-core 1.1.3
Do I need to manually include the innermost including library and exclude logback-classic
from that to get rid of the dependency? I guess that would be org.projectodd.wunderboss/wunderboss-core
no, you can add an exclusion in luminus-immutant/luminus-immutant of ch.qos.logback/logback-classic
luminus-immutant/luminus-immutant {:mvn/version "0.2.5" :exclusions [ch.qos.logback/logback-classic]}
that will exclude logback-classic, and it's dependency logback-core
Magic! Thank you @U064X3EF3and @U0AT6MBUL!