On Feb 6, 2009, at 8:45 AM, Laurent PETIT wrote:

Hello,

Does it also mean that the following use case will work with *reload- all* :

- x.y.z is a lib that is made of two files : x/y/z.clj, and x/y/ z1.clj , and z.clj loads z1.clj
- x.y.z is compiled
- z1.clj is modified
- x.y.z is compiled => even if x/y/z.clj nor x/y/z__init.class are in sync, the changes in z1.clj will be reloaded, because z1.clj will be forced to be reloaded from source file

?

Is my understanding correct ?

Yes, I tested it and for that case, the following will recompile x.y.z1:

        (binding [*reload-all* true]
          (compile 'x.y.z))

With *reload-all* in place, one could also provide clojure.core/ compile-all which calls "load-all" internally rather than "load-one". This would recompile everything on which the given lib (directly or indirectly) depends without regard to mod-dates. (And because *loaded- libs* is still at work, each lib would only be compiled once.)

If so, ++1 for this !

I'm glad the proposed change will help with the situation you asked about. The :reload-all mechanism is currently broken in Clojure and I would like to fix it. I'll be happy to include a clojure.core/compile- all in that patch if it's welcome. (I think it would be useful.)

--Steve

2009/2/6 Stephen C. Gilardi <squee...@mac.com>


On Feb 6, 2009, at 8:28 AM, Stephen C. Gilardi wrote:

When *reload-all* is true, RT.load() will (re)load all libs from their ".clj" files even if they're already loaded.

To clarify:

When *reload-all* is true, RT.load will (re)load any lib it is asked to load from the lib's ".clj" file even if the lib is already loaded.

--Steve



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to