Welcome! Please see the About page for a little more info on how this works.

0 votes
in Compiler by

In this comment: http://dev.clojure.org/jira/browse/CLJ-1100?focusedCommentId=35510&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-35510 Rich said that Vars whose name contains a dot are not supported, but the current implementation allows their definition.
This patch makes (def foo.bar) throw a compile-time exception

4 Answers

0 votes
by

Comment made by: alexmiller

I'm curious whether this breaks existing code in the wild.

0 votes
by

Comment made by: bronsa

I find this hard to believe given the current behaviour:

`
user=> (def a.b 1)

'user/a.b

user=> a.b
CompilerException java.lang.ClassNotFoundException: a.b, compiling:(NO_SOURCE_PATH:0:0)
`

one would need to go out of his way and refer to the var namespace qualified everywhere to make it work

0 votes
by

Comment made by: bronsa

After a brief conversation on #clojure, I updated the patch to only throw on non-macro defs so that macros like clojure.core/.. and clojure.core.incubator/.?. will work fine

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1516 (reported by bronsa)
...