On Tue, Apr 7, 2009 at 7:45 AM, billh04 <[email protected]> wrote: > > I downloaded and installed NetBeans and the Enclojure plugin. > > I am not clear on how to setup the "main" class. > > I modified the "main" class generated by the template to look like the > following: > > ============================= > (defn -main ([args] (startNewAchiTask)) > ([ ] (-main nil))) > ============================= > > This works, but I am not sure what is going on. > > Why are there parentheses around "[args] (startNewAchiTask)"?
This function accepts either one or zero arguments. The first list is for the former case. The second one is for the latter. > What is "([ ] (-main nil))"? If it is called with zero arguments: (-main) it will automatically call itself with a single argument of nil: (-main nil) > Thanks for any help on these questions. See also http://clojure.org/special_forms#fn (defn expands into (def ... (fn ...))) and http://clojure.org/api#defn -- Michael Wood <[email protected]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
