If you create a namespace with associated vars interactively in the repl, and 
subsequently try to use that functionality in other namspaces with 
clojure.core/use, an exception is thrown:

    FileNotFoundException Could not locate cljsh/docs__init.class or 
cljsh/docs.clj on classpath:   clojure.lang.RT.load (RT.java:430)

I can understand that no file can be located as there is none…

clojure.core/require throws the same exception (as it seems to use the same 
clojure.core/load-libs under the cover).

Stand-alone, clojure.core/refer does work, however.

If I read the docs for clojure.core/require, it is clear that it has to do with 
loading of code in files.

However, from a usability point of view, wouldn't it make more sense to let 
clojure.core/require just return nil and do nothing if the namespace is already 
loaded (unless the :reload option is give). Not sure why require actually 
checks without any :reload directive… if the namespace is already loaded, and 
the associated lib-files can be found, it's not supposed to do anything anyway, 
if I understand it well.

Or maybe I miss some of the subtleties between a lib and a namespace as 
concepts and implementations (?).

-Confusingly yours, FrankS.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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