Okay, then I’m the odd one out! :))
To me that just reminds me of all the statefullness and imperative code I’d been running away from by coming to Clojure. Looking at that example again I just have to conclude that maybe the problem space requires it and there is no clean way to abstract it away.
You guys are way better coders than me so I think network/web/db code is probably just kinda tricky that way and in my 10+ years coding I’ve never touched that whole area. So it’s my own blindspot and I don’t really want to judge stuff I don’t know.
But nonetheless it sort of leaves me with the feeling it’s orthogonal to functional programming and immutable datastructures (and I like when the tools synergize and lean into that). The more I look at it the goofier it feels. Stuff like empty binding b/c you’re trying to stuff something into the sequence of operations … I can’t help but feel you’re sorta using an escape hatch to fight the original intent of the form - if that makes sense?
You’re kinda cramming imperative linear C-like step by step code into something that’s really about setting some local bindings.
For instance something like this
(def a 10)
(def b (state-change-and-get a))
(change-some-state b)
(def c (get-some-state b))
(other-state-change c)
to my eyes looks like a bit less of a hack than
(let [a 10
b (state-change-and-get a)
_ (change-some-state b)
c (get-some-state b)
_ (other-state-change c)]
nil)
But you can’t do defs in a function - so it’s not a really a solution
Could just be a matter of familiarity though :))