hyperfiddle 2026-01-19

Dustin Getz (Hyperfiddle) 2026-01-19T15:12:51.613839Z

Fun experiment

👀 2
Dustin Getz (Hyperfiddle) 2026-01-19T15:19:40.216919Z

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

🤯 8
😭 3

$ clj-kondo --lint test.cljc --lang cljs
test.cljc:4:10: error: Unresolved symbol: foo
linting took 14ms, errors: 1, warnings: 0

I 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

Dustin Getz (Hyperfiddle) 2026-01-19T15:22:12.100299Z

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

😵‍💫 1

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?