Fork me on GitHub
#clojure-europe
<
2021-05-19
>
pez05:05:30

Ah, something to go with the coffee would be sweet! Morning, btw. 😃

slipset07:05:26

So finished up removing our old java based logging and replacing it with timbre. In doing so I had to read a bit of the source for timbre, which is kind’a interesting. Fairly different from how I write code 🙂 Not passing judgement, just observations.

borkdude07:05:01

We've been using timbre for a long time and it serves us well.

simongray09:05:45

@slipset what's notable in particular?

Fahd El Mazouni12:05:44

wow a let to define private bindings, quite cool

borkdude11:05:08

Recorded my talk...

👍 12
🍻 4
4
borkdude11:05:29

@slipset let over lambda is a useful pattern, if you want to share data between functions but not necessarily want to expose that data as top-level vars

otfrom13:05:35

someone should write a book about let over lambda

borkdude11:05:41

But it's less usual than just defining some private vars I guess

slipset12:05:59

Unrelated, but map-vals seems to me to be an indicator of the wrong data-structure.

val_waeselynck13:05:17

Playing the devil's advocate: arguably, we only use maps, vectors etc. because our data isn't as regular as we'd like it to be, right? From that perspective, I wouldn't try too hard to be principled about manipulating maps and vectors. Arguably, when you can be principled, your data should be in some kind of relational engine

val_waeselynck13:05:17

Playing the devil's advocate: arguably, we only use maps, vectors etc. because our data isn't as regular as we'd like it to be, right? From that perspective, I wouldn't try too hard to be principled about manipulating maps and vectors. Arguably, when you can be principled, your data should be in some kind of relational engine

otfrom13:05:21

I find I don't use map-vals as I'll often want to (into {] (map (fn [[k v]] [k (something-to-v-possibly-based-on-k k v)) my-map)

dominicm15:05:11

Error: Unexpected ]

otfrom15:05:32

Nah, I type it right when paredit helps me

borkdude15:05:42

I like it when paredit helps me. I don't like it when paredit prevents me from fixing a mistake.

borkdude15:05:09

My workaround is usually to go into text-mode and then fix it manually 😨

pez15:05:55

How would it stop you from fixing a mistake?

borkdude15:05:39

if you have something like this: ([)]

borkdude15:05:03

there's just nothing I can do to fix it within paredit-mode, it doesn't let me

djm15:05:47

C-u C-d lets you delete stuff, no?

genRaiy15:05:58

Isn't that the clj-kondo logo?

clj-kondo 11
mccraigmccraig15:05:36

similar with smartparens - you have to toggle smartparens-strict-mode afaik

borkdude15:05:40

@djm_uk no, that doesn't work in that situation, at least not in my editor

genRaiy15:05:17

@borkdude you probably should use a modern editor

emacs 8
borkdude15:05:26

I like basic terminal editors

😝 4
borkdude15:05:12

so tl;dr: I am using smartparens and I have to disable strict mode to be able to fix it

pez15:05:00

Maybe @raymcdermott means Calva. Really hard to type that with Calva Paredit. But fixing it is easy. alt+backspace to delete stuff w/o balance check. And also, a lot of unbalanced stuff you can just backspace.

genRaiy15:05:02

I'm assuming Calva is epic, also with Cursive you can easily switch between structural editing between paredit / parinfer / none

pez15:05:54

Haha, but, yes, easy to switch to CaveMan mode in Calva.

😬 4
pez15:05:10

smartparens works with html and stuff too, iirc?

djm15:05:31

Fwiw, with Emacs + paredit, C-u C-d lets me fix that scenario. As does two lots of M-s (`paredit-splice-sexp`). No idea about smartparens - I couldn't make it work the same as paredit so gave up on it

mccraigmccraig15:05:26

lol, C-u 0 C-d let me unbalance a sexp with smartparens, but also seems to have crashed my emacs 🙈

🎉 4
thisisfine 4
otfrom16:05:03

Or you can just yank it and then C-q ( the right thing back in

otfrom16:05:25

(yanking w/o using select sexp or forward sexp being when I tend to mess up my parens)

4