It would perhaps be a lot more inefficient. >From what I can understand, clojure loads the namespace in question and the actual command to the compiler is "write this namespace to here". It checks symbols from other modules and does a very light sort of link step. This requires knowledge of other modules; something that can be gathered once and used repeatedly if the whole system is loaded once.
I think Clojure's compile step is a long way beyond the single file compile system; whereas c++ moved into precompiled headers and lots of other nonsense, clojure just loads the system as it needs it and then writes out what you request written out. Is this an accurate characterization of the situation? Chris On Feb 13, 2:10 pm, Mark Volkmann <r.mark.volkm...@gmail.com> wrote: > On Fri, Feb 13, 2009 at 3:00 PM, Stephen C. Gilardi <squee...@mac.com> wrote: > > > > > On Feb 13, 2009, at 3:47 PM, Mark Volkmann wrote: > > > Is there a reason why it would be inadvisable or particularly > > difficult to create a "cljc" script, short for "Clojure compile", that > > would take a path to a Clojure source file and compile it to .class > > files? It seems tedious to have to add ":gen-class" to the source > > file, start a REPL, and enter a compile form. > > > The requirement that the destination dir exist and be in classpath at the > > time you launch the Clojure instance that does the compiling makes it a > > little difficult. It means you can't create the target, add it to classpath, > > and compile all in one Clojure instance. Should be a show-stopper though. > > I don't see any reason why it would be inadvisable. > > 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? > > -- > R. Mark Volkmann > Object Computing, Inc. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---