Putting (ns test) in both files means that the content of the files are in
the same namespace, this is essentially the same as putting everything in
the same file. To be able to access something from the other file you need
to "require", or "use" the other namespace.

If you want to access the content of test1 in test2, you can put the
following in the files:

test1.clj
(ns test.test1)

test2.clj
(ns test.test2 (:use test.test2))
; everything in test1 is accessible

For more detail:
http://clojure.org/namespaces
http://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns

Jonathan

On Mon, May 16, 2011 at 7:02 AM, MohanR <radhakrishnan.mo...@gmail.com>wrote:

> As mentioned in my previous question I didn't use (ns test.test1) but
> only (ns test) and it worked.
>
>
> (ns test.test1) throws
>
> java.lang.Exception: Unable to resolve symbol
>
> when I call a method in the other .clj file
>
>
> Thanks,
> Mohan
>
> --
> 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
>

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