2009/4/18 Stuart Sierra <the.stuart.sie...@gmail.com>

>
> On Apr 17, 7:16 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote:
> > I have a proposal for a standard way to make a namespace "executable"
> > and to invoke it as a program/script.
> ...
> >      - add a key to the "ns" form to specify, as a symbol, the name of
> > a function to be called when the namespace is "invoked" as a script.
> ...
> > Thoughts?
>
> 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 "public static void main(String[] args)" is already the standard
> Java way to make a class executable.
>

There should be STMs for e-mails :-)

I agree with Stuart's answer, of course, just wanted to add that it could
also be "watheverprefix-main" if (:gen-class) defines a prefix.
And I still see value in having the :main keyword if the (:gen-class) is not
necessary.

Regards,

-- 
Laurent

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