Fork me on GitHub
#clojure-uk
<
2021-03-02
>
jiriknesl05:03:46

Ok, thank you. I remember using Dreamweaver too. It was very advanced for those times.

dharrigan07:03:56

Good Morning!

djm07:03:00

👋

danm08:03:28

I feel rough as, horrible sore throat, which I don't know if it's due to the cold I seem to have or the covid test I went for yesterday as a precaution where I had to rub a brush on my tonsils, which are the main thing hurting (it was negative)

dharrigan08:03:11

Probably that

dharrigan08:03:24

Too enthusiastic 🙂

dharrigan09:03:27

Say you had to transform this [:a :b :c :d] to this [[:a :b] [:b c:] [:c :d]] Thoughts?

mccraigmccraig09:03:32

(->>  [:a :b :c :d] (partition 2 1) (mapv vec))

rickmoynihan16:03:10

@U11EL3P9U Also works as a transducer if you use partition-all (into [] (partition-all 2) [:a :b :c :d]) If you want this form because you’re wanting to build a map you can also skip the intermediate collections and do: (into {} (partition-all 2) [:a :b :c :d])

dharrigan16:03:19

Although the form is slightly different

dharrigan16:03:38

(into [] (partition-all 2) [:a :b :c :d]) ;; [[:a :b] [:c :d]]

dharrigan16:03:15

(->> [:a :b :c :d] (partition 2 1) (mapv vec)) ;; [[:a :b] [:b :c] [:c :d]]

rickmoynihan16:03:20

oh sorry didn’t notice you wanted the step

dharrigan16:03:26

that's okay 🙂

dharrigan16:03:42

It was more a thought exercise, rather than something I need right now 😉

Conor09:03:48

It's interesting that the Kotlin equivalent is list.zipWithNext(). I wonder if people tend to do it more in Kotlin land, enough to warrant a library method?

djm09:03:33

It's useful for comparing things with what comes next in a list/string

alexlynham10:03:33

i feel like you could do that with juxt but my brain isn't in the zone rn

folcon10:03:17

You'd still have to partition right? As juxt works at an single element level?

folcon10:03:34

I'm assuming that you want to map the juxt

alexlynham10:03:45

ahh yes cos you need the prev element

alexlynham10:03:47

you're right

mccraigmccraig16:03:42

i've been working on an effectful lib for clj/s ... not quite ready yet, but if anyone cares to take a look, comments and thoughts are welcome: https://cljdoc.org/d/mccraigmccraig/promisefx/0.0.1.7-SNAPSHOT/doc/readme

dharrigan21:03:56

I seem to recall someone had a clojure pub/sub framework for sending messages between different (jvm) clojure instances - anyone recall the name?