This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-12
Channels
- # aleph (5)
- # announcements (1)
- # asami (29)
- # babashka (2)
- # beginners (36)
- # biff (1)
- # cider (6)
- # clj-kondo (29)
- # clj-together (5)
- # clojars (21)
- # clojure (11)
- # clojure-austin (5)
- # clojure-czech (1)
- # clojure-europe (23)
- # clojure-hk (1)
- # clojure-italy (1)
- # clojure-nl (1)
- # clojure-uk (1)
- # clojurescript (38)
- # clojurewerkz (1)
- # cursive (10)
- # data-science (2)
- # datalevin (15)
- # datomic (8)
- # duct (5)
- # emacs (36)
- # events (4)
- # fulcro (7)
- # garden (1)
- # gratitude (1)
- # interop (4)
- # introduce-yourself (1)
- # leiningen (1)
- # missionary (3)
- # music (3)
- # nbb (4)
- # off-topic (21)
- # polylith (6)
- # remote-jobs (5)
- # shadow-cljs (19)
- # specter (4)
- # xtdb (4)
Not particularly a clojure question, since its just java interop, but can someone help me make sense of this? Why does the comparison changes in behaviour halfway?
Well, I'm sorry I can't help you, but I'll keep an eye on that thread. It's probably correct in some strange logic
Well... it obviously does ignore white space, but to hear that's the expected behaviour is... surprising.
Hi everyone, I am trying to construct an array of variable layer in the snippet below :
(.then ^EventHandlerGroup acc
^"[Lcom.lmax.disruptor.EventHandler;" (into-array layer))
but I keep getting array element type mismatch
:
java.lang.IllegalArgumentException
array element type mismatch
Array.java: -2 java.lang.reflect.Array/set
RT.java: 1777 clojure.lang.RT/seqToTypedArray
RT.java: 1750 clojure.lang.RT/seqToTypedArray
core.clj: 3440 clojure.core/into-array
core.clj: 3431 clojure.core/into-array
The elements in the layer
are all instances of EventHandler
:
2022-07-12T12:31:10.867Z localhost.localdomain INFO [hermes.lib.system.components.m1.disruptor-v2-ioc:66] - [(mapv type layer)] => [[hermes.van_buren.sle_router.core.tracker.Tracker-v1 hermes.van_buren.sle_router.core.journaller.Journaller-v1 hermes.van_buren.sle_router.core.emitter.Emitter-v1 hermes.van_buren.sle_router.core.logger.Logger-v1 hermes.van_buren.sle_router.core.accounter.Accounter-v1]]
2022-07-12T12:31:10.868Z localhost.localdomain INFO [hermes.lib.system.components.m1.disruptor-v2-ioc:67] - [(mapv class layer)] => [[hermes.van_buren.sle_router.core.tracker.Tracker-v1 hermes.van_buren.sle_router.core.journaller.Journaller-v1 hermes.van_buren.sle_router.core.emitter.Emitter-v1 hermes.van_buren.sle_router.core.logger.Logger-v1 hermes.van_buren.sle_router.core.accounter.Accounter-v1]]
2022-07-12T12:31:10.869Z localhost.localdomain INFO [hermes.lib.system.components.m1.disruptor-v2-ioc:68] - [(mapv (partial instance? EventHandler) layer)] => [[true true true true true]]
What do you think I'm doing wrong ?
Thanks a lotFrom (doc into-array)
:
> The array's
> component type is type if provided, or the type of the first value in
> aseq if present, or Object.
So, instead of (into-array layer)
just use (into-array Object layer)
.
Thanks @U2FRKM4TW Yep setting the type fixed the issue