On Sep 3, 6:09 pm, "Michael Reid" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> > Good point. It seems that :use would suffice except if both of the following
> > are true for a particular namespace:
> > - it's defined outside of a lib,
> > - it's reasonable to want to refer to it.
>
> > I'm not aware of any uses of namespaces that meet both of those criteria.
> > Does anyone else know of any?
>
> One thing I encountered with the new (ns) is when some Java code that
> operates with Clojure creates a Namespace before the corresponding
> .clj file is loaded. With the current behaviour, when the .clj loads
> and calls (ns com.my-ns) it does not automatically refer 'clojure
> since the namespace was already created by the Java code.
>
> In this case a call to (clojure/refer 'clojure) was necessary.
>
> Again we're talking about 'clojure, but its not inconceivable to me
> that a similar situation could arise with a different namespace. A
> manual call to clojure/refer is not a big deal to me, but being able
> to contain this in a :refer clause in the call to (ns) would feel a
> little cleaner.
>
> Use of the general :refer clause would likely be low, but I don't see
> any reason to limit flexibility for when its needed. I wouldn't expect
> there be too much confusion between when to use :use and when to use
> :refer--use :use if you want to load the lib if necessary and refer it
> into the current namespace, and use :refer if you are sure that the
> namespace is already loaded.
>
> Rich might have something else to say about it though :).
>

Given :refer-clojure, I'd hope there are no other scenarios not
covered by use/require.

Rich
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to