On Nov 21, 10:20 pm, Craig McDaniel <[EMAIL PROTECTED]> wrote:
> I can compile and run the example, but it doesn't work with the "/"
> syntax for main, even though main is a static method:
> user> (my.hello/main (into-array ["Bizarro"]))
>
> java.lang.Exception: No such var: my.hello/main
The function is called -main (from a Clojure-POV); notice the leading
dash in front of your definition of main:
> (defn- -main [foo]
> (println "Hello" foo "World!")
> (let [x (my.hello. 42)]
> (prn (.mymax x 21))))
So using
(my.hello/-main (into-array ["Bizarro"]))
instead of
(my.hello/main (into-array ["Bizarro"]))
works, but throws another error because the method is private (using
defn instead of defn- makes this error disappear, too).
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---