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

0 votes
ago in Java Interop by

The map clojure.lang.RT/DEFAULT_IMPORTS defines all of the Java classes that are (by default) available in all Clojure namespaces. In 2007, Rich added and then commented out a number of the clojure.lang classes and interfaces (removed in this commit) without any commentary, and those lines have remained unchanged since.

Is there a reason why the "primary" clojure.lang classes and interfaces aren't imported by default?

1 Answer

0 votes
ago by

Well, where do you stop? Only Rich could tell you but I assume he was experimenting and decided that "where to stop" was with java.lang.

ago by
I think the only one I miss with any regularity is clojure.lang.ExceptionInfo (which post-dates that change anyway) -- and that's mostly because the various java.lang.* exceptions and errors _are_ default imported, so catching ExceptionInfo always looks ugly by comparison.
ago by
Yeah that's the one that got me thinking about this. I rarely have need for other clojure internals (protocol functions cover most everything) but catching ExInfos is quite frequent.
...