Fork me on GitHub
#clj-kondo
<
2022-05-10
>
borkdude09:05:10

Hmm, this: https://clojure.org/guides/repl/enhancing_your_repl_workflow#writing-repl-friendly-programs would maybe be a reason to disable :redundant-fn-wrapper by default. I've come across this situation a couple of times now. /cc @ghadi: what do you think?

imre09:05:43

What would be even more awesome is a linter that warns you about code being not repl-friendly, like #3 vs #4 at that link

imre09:05:57

I kinda prefer #4 to #2 there so the wrapper is still redundant compared to using the var

imre10:05:15

I think your caution regarding the linter is right however. I would surely refactor from 2 to 3 by default as I don't have this thing on my mind most of the time.

seancorfield17:05:52

I just recently learned that #' is "dangerous" in cljs and it's much safer to use a wrapper function (via Thomas Heller).

seancorfield17:05:33

(but I much prefer #' as the REPL-friendly approach in clj -- sounds like something I'll have to remember if I ever get back to writing cljs!)

borkdude17:05:06

@U04V70XH6 if you're writing #joyride scripts, #' works just fine since vars are more like Clojure JVM in SCI, even in JS :)

seancorfield17:05:22

Ah, good to know. Thank you!