π
β π₯
Ah, something to go with the coffee would be sweet! Morning, btw. π
Morning
Morning!
morning
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.
We've been using timbre for a long time and it serves us well.
mogge
morning
@slipset what's notable in particular?
good morning!
@simongray Like this top-level let
with defs
inside https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre.cljc#L244
Indentation here https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre.cljc#L337 is somewhat unusual to me?
Recorded my talk...
@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
But it's less usual than just defining some private vars I guess
Unrelated, but map-vals
seems to me to be an indicator of the wrong data-structure.
Morning
wow a let to define private bindings, quite cool
someone should write a book about let over lambda
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)
;)
Error: Unexpected ]
@otfrom I think you're looking for http://weavejester.github.io/medley/medley.core.html#var-map-kv-vals π
Nah, I type it right when paredit helps me
I like it when paredit helps me. I don't like it when paredit prevents me from fixing a mistake.
My workaround is usually to go into text-mode
and then fix it manually π¨
How would it stop you from fixing a mistake?
if you have something like this: ([)]
there's just nothing I can do to fix it within paredit-mode, it doesn't let me
C-u C-d
lets you delete stuff, no?
Isn't that the clj-kondo
logo?
similar with smartparens
- you have to toggle smartparens-strict-mode
afaik
@djm_uk no, that doesn't work in that situation, at least not in my editor
@mccraigmccraig ah that's the one
@borkdude you probably should use a modern editor
I like basic terminal editors
so tl;dr: I am using smartparens and I have to disable strict mode to be able to fix it
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
.
I'm assuming Calva is epic, also with Cursive you can easily switch between structural editing between paredit / parinfer / none
Haha, but, yes, easy to switch to CaveMan mode in Calva.
smartparens
works with html and stuff too, iirc?
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
lol, C-u 0 C-d
let me unbalance a sexp with smartparens, but also seems to have crashed my emacs π
Or you can just yank it and then C-q (
the right thing back in
(yanking w/o using select sexp or forward sexp being when I tend to mess up my parens)