Closed pmonks closed 1 year ago
Although this isn't enforced by defn
in Clojure (you can still define vars using this name), just because the name has a .
, it only considers this to be a class. Note that this does work:
user=> (#'invalid.varname 1)
1
In CLJS the behavior is even more fuzzy since (invalid.varname :foo)
could mean ((.-varname invalid) :foo)
. I think I'd rather implementing this as a clj-kondo rule "var name should be symbol without dots" rather than doing extra checks during SCI analysis. I'll make an issue for that.
Note that this also works:
user=> (user/invalid.varname 1)
1
version
JVM 17.0.4.1+1 (Linux/amd64) with Clojure 1.11.1 JVM 17.0.4.1+1 (Mac OS X/x86_64) with Clojure 1.10.3 sci 0.4.33
platform
Linux macOS
problem
sci accepts a full stop (.) character when referencing a var name, when ClojureJVM does not.
repro
actual behavior (sci)
:foo
expected behavior (ClojureJVM)
or similar error message appropriate to sci.
additional context
This is probably a very low priority corner case I realise, but it would be nice if sci more closely followed Clojure's behaviour here.