On Apr 17, 2009, at 10:28 PM, Stuart Sierra wrote:
I suggest using a "-main" function for this purpose. Then with (ns ... (:gen-class)) you can generate a static Java class with same behavior.
And if the :gen-class clause renamed main would the main function for this namespace be that named function?
And "public static void main(String[] args)" is already the standard Java way to make a class executable.
There's currently no way to return a "status" value from an argument with that signature without using System/exit which has the unfortunate side effect of also shutting down the JVM.
We could create a var for the status return analogous to *command-line- args*. One could wrap the invocation of the main function with:
(binding [*command-line-status* 0] (apply the-main *command-line-args*) *command-line-status*)Which would assume success, but allow the-main to indicate another status code with
(set! *command-line-status* the-status) --Steve
smime.p7s
Description: S/MIME cryptographic signature