You can run it like python, ruby, etc.

https://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips

Basically, at the top of a clj file, put:

":";exec /path/to/java -cp "/path/to/clojure.jar" clojure.main $0 "$@"

(ns command-line-args)

(defn command-line? []                               
  (.isAbsolute (java.io.File. *file*)))

(defn main [] (println *command-line-args*))

(if (command-line?) (main))


If you need more dependencies, you can make an uberjar or use some code 
that dynamically pulls in dependencies like boot, lein, or pomegranate. I 
used this strategy when I needed my code to work on other people's systems 
with minimal installation requirements.

On Thursday, June 9, 2016 at 12:08:39 PM UTC-4, Jiacai Liu wrote:
>
> I  started learning clojure recently, and I am annoyed at the way to run 
> it (aka. lein run). why clojure script can't be run like python,ruby or 
> scala, like python <file>.py
>

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to