Laurent PETIT a écrit :
> I tried this, but it didn't seem to work :
> ; a/b/c.clj
> (ns a.b.c)
> (defn f [] :f)
> (load "c1")
>
> ;a/b/c1.clj
> (in-ns 'a.b.c)
> (defn g [] :g)
>
> ;in REPL
> user=>(let [real-load clojure.core/load]
>   (binding [clojure.core/load (fn [f] (println "file loaded: " f) 
> (real-load f))] (compile 'a.b.c)))
> file loaded:  a.b.c
> a.b.c
Ok, here is what I get:
;; no class files yet
user=> (let [real-load load] (binding [*compile-path* "/tmp/" load 
(fn[x] (println "LOAD" x) (real-load x))] (compile 'a.b.c)))
LOAD /a/b/c
LOAD c1
a.b.c
;; now class files exist but they seems to be reloaded:
user=> (let [real-load load] (binding [*compile-path* "/tmp/" load 
(fn[x] (println "LOAD" x) (real-load x))] (compile 'a.b.c)))
LOAD /a/b/c
LOAD c1
a.b.c
;; the third time there's no reload:
user=> (let [real-load load] (binding [*compile-path* "/tmp/" load 
(fn[x] (println "LOAD" x) (real-load x))] (compile 'a.b.c)))
LOAD /a/b/c
a.b.c
;; I touch c1.clj
user=> (let [real-load load] (binding [*compile-path* "/tmp/" load 
(fn[x] (println "LOAD" x) (real-load x))] (compile 'a.b.c)))
LOAD /a/b/c
a.b.c
;; I touch c.clj
user=> (let [real-load load] (binding [*compile-path* "/tmp/" load 
(fn[x] (println "LOAD" x) (real-load x))] (compile 'a.b.c)))
LOAD /a/b/c
LOAD c1
a.b.c
;; No reload, but it's the second time:
user=> (let [real-load load] (binding [*compile-path* "/tmp/" load 
(fn[x] (println "LOAD" x) (real-load x))] (compile 'a.b.c)))
LOAD /a/b/c
a.b.c
user=>

So it seems there's a weird case when there's no class files yet and 
that (and a dirty repl) led me to wrong conclusions yesterday.

Christophe

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