However, if Clojure will be the only scripting language you use, then you can execute Clojure scripts without a problem by just using RT.var (a static method in the clojure.lang.RT class), and various methods on clojure.lang.Var. There is some code in clojure-jsr233 that demonstrates exactly this, for obtaining references to core functions, and loading/evaluating code:
Hope that helps,
- Chas
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
I use Clojure as a scripting language within a JVM-based application
(not Java, but it uses Java interop to access Clojure) and the
patterns I use are:
* clojure.lang.RT.var( "the.namespace", "some-name" ) - get a
reference to the.namespace/some-name
* clojure.lang.RT.var( "clojure.core", "load" ).invoke( "filename" ) -
to load a source file from the classpath
* reference.invoke( my, args ) - to call whatever var is in the
reference (like the clojure.core/load example above)
Sean
I'm a bit fuzzy on how to enable an application to be connected to
from a command line repl. Any good articles on that? Preferably using
Clojure 1.3.0 / clojure.tools.nrepl. I read the tools.nrepl doc but it
didn't really "click" for me...
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
If you don't, you'll need to start an nREPL server, and connect to that using an nREPL client. That actually has some advantages even if you do have stdin/out (multiple sessions, for one), but I wouldn't say that nREPL is necessarily preferable for those reasons. Use the right tool for the job. :-)
- Chas