On Mar 15, 2009, at 4:42 PM, Tom Faulhaber wrote:
the :gen-class directive needs (:main true) to tell it you have a main function: (ns temp-converter (:gen-class (:main true))
(:main true) is the default for the :gen-class directive. Here's the relevant portion of (doc ns) (and http://clojure.org/API#ns): (:gen-class ...), when supplied, defaults to :name corresponding to the ns name, :main true, :impl-ns same as ns, and :init-impl-ns true. All options of gen-class are supported. The :gen-class directive is ignored when not compiling. If :gen-class is not supplied, when compiled only an nsname__init.class will be generated.
and the main function needs an argument declaration: (defn -main [] (main))
That declaration works, but doesn't allow for (java level) command line arguments.
This declaration (defn -main [& args] ...)allows for any number of command line arguments which may be desirable in some cases.
--Steve
smime.p7s
Description: S/MIME cryptographic signature