Fork me on GitHub
#clojure
<
2022-07-12
>
Miguel09:07:47

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?

Hermann09:07:08

Fascinating... What happens when you change locale and/or strength?

Miguel09:07:07

Nothing 😅 same issue.

Hermann09:07:58

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

Hermann10:07:18

Well... it obviously does ignore white space, but to hear that's the expected behaviour is... surprising.

Miguel11:07:32

Interesting stuff, thank you.

Ho0man12:07:34

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 lot

p-himik12:07:05

From (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).

Ho0man12:07:15

Thanks @U2FRKM4TW Yep setting the type fixed the issue