In Compiler.java, resolveSymbol() uses == to compare a Symbol's ns and the found namespace's name. This can result in a false comparison result, though the name's may be equal. In the following example:
ond.core=> (require '[clojure.string]) nil ond.core=> `(clojure.string/join "," [1 2]) false : true ;; reported from System.out.println code I put into Compiler.java for == vs .equals() nil
The result is that a new Symbol is allocated, when the previous one should be returned.
Prior to Clojure 1.7, Symbol name and ns were interned so == would actually have worked, but that is no longer the case.
In Compiler.java, resolveSymbol() uses == to compare a Symbol's ns and the found namespace's name. This can result in a false comparison result, though the name's may be equal. In the following example:
ond.core=> (require '[clojure.string])
nil
ond.core=> `(clojure.string/join "," [1 2])
false : true ;; reported from System.out.println code I put into Compiler.java for == vs .equals()
nil
The result is that a new Symbol is allocated, when the previous one should be returned.
Prior to Clojure 1.7, Symbol name and ns were interned so == would actually have worked, but that is no longer the case.
Patch: resolve-symbol-equals.diff
Screened by: Alex Miller
[1] - https://groups.google.com/forum/#!topic/clojure-dev/58fYUSIEfxg