Re: Clojure script in the classpath : + Servlet Container Question

2010-06-25 Thread Chas Emerick
Yes, you can load Clojure code from Java and invoke it however you like: RT.var("clojure.core", "require").invoke(Symbol.intern("your.namespace.here")); And now you can use your clojure fns: Var myfn = RT.var("your.namespace.here", "myfn"); myfun.invoke(arg1, arg2, etc); I'd like to have a

Re: Clojure script in the classpath : + Servlet Container Question

2010-06-20 Thread Todd
Is it possible to load up .clj files from the classpath of an arbitrary java app? For example, could you proxy HttpServlet and run your servlet as a .clj from within a servlet container? If not, and you have to gen-class the servlet, could the servlet bootstrap the clojure environment and proce

Re: Clojure script in the classpath

2010-06-19 Thread Paul Moore
On 19 June 2010 17:22, Chas Emerick wrote: > If you're just looking to run a script that happens to be on the classpath, > you can do so by prepending an '@' character to the classpath-relative path > to the script. > > So, if a directory foo is on your classpath, and a clojure file you'd like > t

Re: Clojure script in the classpath

2010-06-19 Thread Paul Moore
On 19 June 2010 07:24, rzeze...@gmail.com wrote: > On Jun 18, 6:15 pm, Paul Moore wrote: >> I've just seen a couple of postings which, if I'm not mistaken, imply >> that it's possible to have a Clojure script in my classspath. Is that >> right? > > Yes, you can have .clj files on your classpath.

Re: Clojure script in the classpath

2010-06-19 Thread Chas Emerick
If you're just looking to run a script that happens to be on the classpath, you can do so by prepending an '@' character to the classpath-relative path to the script. So, if a directory foo is on your classpath, and a clojure file you'd like to run is at foo/bar/script.clj, then you can run

Re: Clojure script in the classpath

2010-06-18 Thread rzeze...@gmail.com
On Jun 18, 6:15 pm, Paul Moore wrote: > I've just seen a couple of postings which, if I'm not mistaken, imply > that it's possible to have a Clojure script in my classspath. Is that > right? Yes, you can have .clj files on your classpath. In fact, you can pretty much have anything on your classp

Clojure script in the classpath

2010-06-18 Thread Paul Moore
I've just seen a couple of postings which, if I'm not mistaken, imply that it's possible to have a Clojure script in my classspath. Is that right? I come from a Python background (little or no Java experience) and the idea that anything other than .class or .jar files (or directories) could be on t