On Jan 8, 7:28 pm, lpetit <laurent.pe...@gmail.com> wrote:
> It seems that (compile) generates .class files as expected, and also
> loads the lib in the environment as well.
>
> Is it a (apparently undocument) feature ? Or a bug ?

It's a feature.  I think it's documented somewhere. :)

> And also, it seems that (compile) does not load the lib from the
> compiled classes, but from the source files.

"compile" calls "load" with some special variable bindings. So, yes,
both will read the source files.

> I guess that, because if the lib contains top level calls that do not
> contribute to produce the classes (for example top level (println)s),
> when I call (compile), those (println)s are executed.
>
> Later on, if I call (load) (from a fresh clojure environment) from the
> compiled classes, the top level (println)s are not executed, since not
> compiled.

Yes, that's the expected behavior.   "compile" only saves the things
defined in the namespace.

-Stuart Sierra
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to