Hello, Here are some (quick) thoughts :
- The wikibook example could also be adapted to the new way of doing things : having add1, otherfunc and morefuncs files in the same directory as ourlib ? - if the other "parts" of the lib are not in the same directory/package as the "master lib file", where will the functions defined in the loaded parts be generated by AOT ? Still in the root package, or in the package with the lib name at the end ? If it is the second option, then it doesn't look natural to me. - Why change ? I'm not sure there is a strong argument to change the way it is done currently. Let me explain a little bit more : I too have the feeling that the current way of doing things with libs may not be the final one. So I think it may change in the future. But I would not like it to change too often. It is sufficiently good now (almost that's my point of view), and I would like to see it change for a good reason, when experience help us grab the correct abstraction. Again, those are very quick thoughts (no more time to think about it right now), Regards, -- Laurent 2009/2/10 Stephen C. Gilardi <squee...@mac.com> > I came across this when updating the wikibook concepts page, Libraries > section, to be correct for current Clojure behavior. > > In an early implementation of the code that handles libs, the resource > (file) for lib a.b.c was at the path "a/b/c/c.clj" within classpath. At that > time it was natural to consider "a/b/c/" as the lib's directory. > > Later, the resource for the library a.b.c changed to the path "a/b/c.clj" > and the lib's directory became "a/b/". > > I think the lib handling code should be changed such that the directory > associated with lib a.b.c is (again) "a/b/c/". > > The advantage of this comes into focus most sharply in a ":load" clause > within "ns". > > Here's the updated example from the wikibook: > > (ns example.ourlib > (:load "ourlib/add1" > "ourlib/otherfunc" > "ourlib/morefuncs")) > > With the change I'm proposing, this would become: > > (ns example.ourlib > (:load "add1" > "otherfunc" > "morefuncs")) > > Currently core.clj ends with 3 load calls to load in more pieces of > clojure.core that were each big enough to warrant a separate file. > > The directory structure in src/clj/clojure is (in part): > > src/clj/clojure/ > core.clj > core_print.clj > core_proxy.clj > genclass.clj > > With the proposed change, this would become: > > src/clj/clojure/ > core/ > core_print.clj > core_proxy.clj > genclass.clj > core.clj > > or, perhaps removing the "core_" prefixes: > > src/clj/clojure/ > core/ > print.clj > proxy.clj > genclass.clj > core.clj > > There is also at least one lib in clojure-contrib that would need to be > updated. > > I welcome discussion of this proposed change with the goal of entering an > issue and providing a patch. In the patch, I would also update the doc > string for clojure/require to reflect current Clojure behavior. > > Thanks, > > --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 -~----------~----~----~----~------~----~------~--~---