On Sep 18, 6:46 am, Kelvin Ward <kelvin.d.w...@googlemail.com> wrote:
> java -cp clojure.jar clojure.main foo.clj
>
> I'm wondering if the code in foo.clj has anyway to know it is being
> executed as a script. In python there's the idiom:

This doesn't exist right now.  The closest equivalent is:

    (ns my-namespace
      (:gen-class))

    (defn -main [& args]
      (println "I was run at the command line."))

This has been discussed at length before.  Clojure isn't really a
scripting language, so it may never support this kind of idiom.

-SS
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to