On Mon, Dec 15, 2008 at 10:41 PM, Daniel Eklund <doekl...@gmail.com> wrote:
>
> I've been trying to get 'ns' right.  The doc for 'require' tells me
> the following about library loading:
>
> "The root resource path
>  is derived from the root directory path by repeating its last
> component
>  and appending '.clj'. For example, the lib 'x.y.z has root directory
>  <classpath>/x/y/z; root resource <classpath>/x/y/z/z.clj."
>
> It looks like this this is out of date as per
> http://groups.google.com/group/clojure/browse_frm/thread/8618a1d93cbbf8b7/58e3f8e5dfb876c9?lnk=gst&q=aot#58e3f8e5dfb876c9
>
> If my observation is correct, could we update the 'require' doc
> string?

You are correct, it should say something like:

  A 'lib' is a named set of resources in classpath whose contents define a
  library of Clojure code. Lib names are symbols and each lib is associated
  with a Clojure namespace and a Java package that share its name. A lib's
  name also locates its source file path using Java's package name to
  classpath-relative path mapping.  All definitions a lib makes should
  be in its associated namespace.  Other resources in a lib
  may be contained in a similarly-named directory.

  'require loads a lib by loading its root resource. The root resource path
  is derived from the root directory path by appending '.clj'. For
  example, the lib 'x.y.z has root resource <classpath>/x/y/z.clj. The root
  resource should contain code to create the lib's namespace and load any
  additional lib resources.

In general, clojure-contrib is a good place to look to find examples
of properly laid-out libs, as well as generally idiomatic Clojure
code.

--Chouser

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