Fork me on GitHub
#clojure-europe
<
2021-04-06
>
dharrigan06:04:27

Good Morning!

joelkuiper06:04:37

good morning 🙂

pez07:04:44

Morning!

simongray08:04:18

Today’s task is… trying to wrap some ancient JS code in a Reagent component to make it reactive and just plain usable from ClojureScript. The documentation has been lost to time, the project is abandoned and it’s really meant for static use, but it’s what the stakeholders want, so I’m gonna make an honest attempt 😉

ordnungswidrig08:04:06

@simongray our prayers are with you. Maybe just secretly reimplement in clojurescript? 😉

simongray08:04:18

that’s plan B 😉

simongray08:04:07

well, really it's plan C, because plan A was getting an intern to make a new timeline in Vega, which the stakeholders didn't particularly like

simongray08:04:30

she loved learning both Vega and Clojure in the 10 weeks I supervised her, though

borkdude09:04:11

babashka now comes with rewrite-clj. this allows you to write tiny scripts and hook them up to e.g. emacs to refactor your code 😊 https://gist.github.com/borkdude/77369ba1b2d0fbd2608a8d12f518ade3

parrot 6
metal 6
🎉 3
pez09:04:31

It’s sort of an LSP now 😃

genRaiy10:04:02

@borkdude it's wonderful to see that terminal editors are improving by the inventive use of CLI tools 😝

borkdude10:04:54

@raymcdermott when will Rich be on? episode 70, or 100?

simongray10:04:46

As soon as Clojure spec is out of alpha!

genRaiy10:04:57

Think of defn as a lazy sequence

borkdude10:04:00

@simongray Is that another phrasing of: when pigs fly? In Dutch we have a saying like this: "When Easter and Pentecostal are on the same day"

simongray10:04:19

That was the idea, yeah 😉

genRaiy10:04:22

@simongray you’re correct in that case

simongray10:04:17

RH will surely deliver. Let's just wait.

borkdude10:04:43

@raymcdermott suggestion for the show: @ericdallo about Clojure LSP.

genRaiy10:04:26

Thanks, I’ll add him to the vector

borkdude10:04:44

at least vectors aren't lazy

😆 6
borkdude10:04:10

(def attack [])
^ my attack vector

lread11:04:03

Oh! That belongs on mugs and tshirts!

jasonbell11:04:37

Hmmm so just found out, well I kinda sensed it anyway, that if you give partition a count number that’s greater than the count of the collection it will return an empty set. (I love the REPL). Meaning, for me at least, that my partition blocks for pmap always need to be divisible by partition count.

jasonbell11:04:56

And I’m on holiday….. this is what I do for fun. 🙂

borkdude11:04:38

@jasonbell there's also partition-all which will probably do the right thing for your use case?

3
jasonbell11:04:54

Ah didn’t know about that @borkdude thanks, I’ll check it out

jasonbell11:04:17

Perfect! Thanks

jasonbell11:04:01

synthetica.engine> (def aa [1 2 3 4])
#'synthetica.engine/aa
synthetica.engine> (partition 3 aa)
((1 2 3))
synthetica.engine> (partition-all 32 aa)
((1 2 3 4))
synthetica.engine> (partition-all 3 aa)
((1 2 3) (4))

jasonbell11:04:09

Excellent, just what I needed.

ordnungswidrig11:04:33

Oh, I wasn’t aware that “partition” would supress values. 😱

🐛 3
simongray11:04:57

me neither… that’s unfortunate

🪲 3
jasonbell11:04:06

synthetica.engine> (def aa [1 2 3])
#'synthetica.engine/aa
synthetica.engine> (partition 32 aa)
()
synthetica.engine> (partition 3 aa)
((1 2 3))

jasonbell11:04:25

News to me as well. I bet it’s all laid out in the documentation though 🙂

jasonbell11:04:46

synthetica.engine> (partition 3 3 nil aa)
((1 2 3) (4))

jasonbell11:04:58

With a pad seems a little untidy for my liking.

agile_geek13:04:00

This is one of those rare “I knew that, I knew that….” moments! (Yes, I am jumping up and down at the back of the class with my hand up)

bananadance 9
genRaiy19:04:37

Goodnight