Hi Stuart,

Thanks, that's good to know - I didn't realize the ns macro did that!
I just had a look at the docstring for ns:

"Sets *ns* to the namespace named by name (unevaluated), creating it
  if needed.  references can be zero or more of: (:refer-clojure ...)
  (:require ...) (:use ...) (:import ...) (:load ...) with the syntax
  of refer-clojure/require/use/import/load respectively, except the
  arguments are unevaluated and need not be quoted.  If :refer-clojure
  is not used, a default (refer 'clojure) is used. Use of ns is preferred
  to individual calls to in-ns/require/use/import:

  (ns foo
    (:refer-clojure :exclude [ancestors printf])
    (:require (clojure.contrib sql sql.tests))
    (:use (my.lib this that))
    (:import (java.util Date Timer Random)
              (java.sql Connection Statement))
    (:load \"/mystuff/foo.clj\"))"

It appears that ns provides a lot of "convenience" functionality!

Cheers,
Bill

On Wed, Oct 29, 2008 at 9:44 AM, Stuart Halloway
<[EMAIL PROTECTED]> wrote:
>
> Hi Bill,
>
> Good stuff. You might also mention that when you actually switch to a
> namespace using the ns macro, clojure gets referred, giving you a
> bunch more stuff:
>
>  (create-ns 'test)
> #=(find-ns test)
> user=> (count (ns-map 'test))
> 96
> user=> (ns test)
> nil
> test=> (ns user)
> nil
> user=> (count (ns-map 'test))
> 513
>
> Cheers,
> Stuart
>
>> Hi all,
>>
>> I've posted a new article on my blog about Clojure Namespaces:
>> http://bc.tech.coop/blog/081029.html
>>
>> I would appreciate any comments/criticisms or additional insights.
>>
>> Thanks,
>> Bill
>> >
>
>
> >
>

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