views:

40

answers:

1

When I enter (use 'some.namespace) in the Repl, the corresponding clojure file is compiled and loaded. Are the compiled class files stored on the file system, or they only reside in the memory? The Repl is started from the command line, no editor/IDE is involved.

+2  A: 

When you use a namespace, no class files are generated anywhere that I know of. The only time class files are generated are if you explicitly AOT compile your code, and most of the time, you won't need to.

You can learn more about compilation here: http://clojure.org/compilation

Rayne
You maybe even don't want to AOT compile things, since it ties the code to a particular clojure version.
kotarak
@Rayne - The link only says "Clojure compiles all code you load on-the-fly into JVM bytecode". It suggests it gets loaded into memory, but it's not stated explicitly.
Adam Schmideg
@[Adam Schmideg] Indeed, that's why I pointed out that class files aren't generated unless you AOT compile. Did I not answer your question? If so, please rephrase.@kotarak Indeed. Plus it's a lot easier to *not* generate class files all the time.
Rayne