On Feb 13, 2009, at 4:10 PM, Mark Volkmann wrote:

As far as I know, the classpath only needs clojure.jar, the src
directory and the classes directory. Here's an idea. The locations of
those could be command-line arguments to the cljc script. They could
default to simply "src" and "classes" relative to the current
directory. clojure.jar could be located via an environment variable
like CLOJURE_HOME.

Is there still a reason the compile can't be done in a single Clojure instances?

If you don't mind your script depending on "classes" already existing, you can use one instance.

In the general case, a complete cljc "program" (in my opinion) would need to:

[1] create the dest dir if it doesn't already exist
[2] launch a clojure instance with that dest dir in classpath
[3] compile

What doesn't work is:

[1] Launch a clojure instance to run your script
[2] create the dest dir using that clojure instance
[3] compile using that clojure instance

It's step 1 of the general case that has to be done outside of the clojure instance that does the compiling. That implies it's done by something else (e.g., bash, python, perl, C) or it's done by a separate instance of Clojure.

Alternatively, if you want to use only one instance of Clojure, you could simply check if the directory exists and exit with a "that dir doesn't exist" message if it doesn't.

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to