Fork me on GitHub

I’m having a problem in Cursive with my REPL initialisation in Clojure 1.4 (and presumably earlier versions). This works fine in 1.5+.


Basically I load a single file which contains various namespaces concatenated together. One of the later namespaces requires an earlier one, and this fails saying it can’t find the file containing the NS.


So it looks like it’s not checking whether the ns is already loaded, or perhaps the fact that the ns is loaded is updated once load-file has finished? Not sure.


Did something change from 1.4->1.5 which would have affected this?

Alex Miller (Clojure team)01:11:02

That was before I was closely involved but check the changelog


I couldn’t see anything obvious there.


I’ll check the source diffs to see if I can spot anything.


looks like protocol callsites are broken when using arrays


@alexmiller: it looks like the jvm verifier can't figure out that the direct interface method path on a protocol callsite can only be reached after a successful instanceof check


so we need an explicit checkcast


@cfleming: I remember that at some point in the past clojure wasn't able to load namespaces that didn't exist on disk


@bronsa: Thanks. In this case the nses load ok, it’s requiring one that was loaded in this fashion that fails. It seems odd, since it implies that Clojure isn’t aware the ns has been loaded yet. IIRC that’s done using refs, I haven’t had time to check if that code changed in 1.5

Alex Miller (Clojure team)02:11:46

@bronsa: thx, I'll look at it next week. It's weird that I have no memory of that ticket being logged. Must have been when I was at scout camp.


@alexmiller: not a regression btw


looks like it never worked


@bronsa: That’s the one, fixed in 1.5