Fun experiment
This is a brutal enough Clojure footgun that I wanted to share: interaction between #_ and #?(:clj …) with no :cljs branch
(ns dustingetz.scratch)
#_#?(:clj 1)
(def foo 42) ; under cljs compilation, the #_ targets this def
(println foo) ; Use of undeclared Var dustingetz.scratch/foo
$ clj-kondo --lint test.cljc --lang cljs
test.cljc:4:10: error: Unresolved symbol: foo
linting took 14ms, errors: 1, warnings: 0I know Cursive has some clj-kondo integration, but it might only run with --lang clj
Wow. Yeah I was reading earlier that reader conditionals are ignored instead of returning nil on unspecified platforms. And I've seen people use #_#_ to ignore the next two forms, so likewise "conditional ignores" and "explicit ignores" stack together I guess
this Clojure rough edge is the source of probably several spooky Electric compiler errors that I have personally experienced, it presents like a "clear shadow cache" kind of bug where there is no apparent link between the error and the program
Yes, I have personally shot myself in the foot several times commenting out reader conditionals like this. Very painful and hair-tearing experiences, sometimes including a feeling of slowly going insane. Bad cocktail 🍸
No linter catches it?