I don't think I explained my need clearly.

I try to rephrase it. Suppose I have a source file named place.clj in
a directory named whale/achi/model like the following:

==== place.clj ========
(ns whale.achi.model.place)
partA
partB
==================

What I want to do is to keep the same namespace but break it into two
files named place.clj as above and placeEvaluation.clj in a
subdirectory place:

==== place.clj =======
(ns whale.achi.model.place
    (:load "place/placeEvaluation"))
partA
==================


==== placeEvaluation.clj ===
partB
======================

When, I do this, I get the error message:

java.lang.Exception: Unable to resolve symbol: -boardPlaces- in this
context (placeEvaluation.clj:19)

since -boardPlaces- is defined in partA, but has not been loaded yet
(I suspect).

I believe the following will work since partA is loaded before partB:

==== place.clj =======
(ns whale.achi.model.place)
partA
(load "place/placeEvaluation")
==================


==== placeEvaluation.clj ===
partB
======================

What I am seeking is how to split a file for one namespace into
multiple files with the same namespace.

Also, any source file that wants to use the namespace
'whale.achi.model.place would need only 'use 'whale.achi.model.place
and would not have to worrry about placeEvaluation but get that loaded
for free.

On Apr 23, 9:29 pm, Drew Raines <aarai...@gmail.com> wrote:
> billh04 wrote:
> > Right now I have the two files "whale.achi.model.place.clj" and
> > "whale.achi.model.placeEvaluation.clj" that make up one name space
> > "whale.achi.model.place".
> > The first file is the "root" of the namespace.
>
> I think you're confused with how Clojure looks for packages in the
> filesystem.  Perhaps you want:
>
>    $ find whale
>    whale/achi/model/place.clj
>    whale/achi/model/place/evaluation.clj
>    $ head -2 whale/achi/model/place.clj
>    (ns whale.achi.model.place
>      (:require [whale.achi.model.place.evaluation :as eval]))
>    $ head -1 whale/achi/model/place/evaluation.clj
>    (ns whale.achi.model.place.evaluation)
>
> -Drew
--~--~---------~--~----~------------~-------~--~----~
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