Cljs case & ^:const

Your text is very hard to read with “…” scattered throughout it. I think what you’re running into is the fact that case does not resolve symbols used in the match on the left hand side. So:

(def FOO "bar")

(case FOO
  FOO "baz"
  "default")
;; => default

Like you said, since it will try and match the value “baz” to the symbol FOO.

(def XYZ 'FOO)

(case XYZ
  FOO "baz"
  "default")
;; => "baz"

So for your case, you should continue to use condp = if you want to store the value you want to match against inside of a var.

1 Like