Hi Greg,
I think you may be working at too low a level with "load".  You should
be able to accomplish the same thing with:

    (ns my-app
      (:require package1 package2))

    (package2/start-app)

my_app, package1, and package2 all need to be immediately under a
directory (or JAR file) on the Java classpath.  Also check out the Ant
build.xml files from Clojure core and clojure-contrib.

-Stuart Sierra


On Jan 6, 1:11 pm, Greg Harman <ghar...@gmail.com> wrote:
> Hi all,
>
> I'm struggling a bit with how best to organize and bootstrap a
> multiple-source file project so that it can be run either command-line
> (java -cp clojure.jar:myapp.jar ...) or by running a load method from
> the REPL without having to explicitly change the classpath in my
> user.clj before running.
>
> Currently my file structure looks like this:
>
> /bootstrap.clj
> /package1/foo.clj
> /package2/bar.clj
>
> And bootstrap.clj looks something like:
>
> (def *namespaces*
>   '("package1/foo" "package2/bar"))
>
> (defn load []
>   (for [namespace *namespaces*]
>     (load namespace)))
>
> This seems to work sometimes, if my REPL's "working directory" is /
> (relative to my project), but not if it's anything else (get a
> java.io.FileNotFoundException).
>
> So, I guess my question is: is this whole approach silly and is there
> a better way to bootstrap a multiple file/package project? If not, how
> best to tweak this?
>
> -Greg
--~--~---------~--~----~------------~-------~--~----~
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