???

2009/2/13 Craig McDaniel <craig...@gmail.com>

>
> I just tried it out to be sure. Overloaded methods with the same arity
> work as expected. Clojure picks the right method to call via
> reflection.
>
> package expmeth;
> public class ClassA {
>    public void hello() {
>        System.err.println("hello from Java!");
>    }
>    public void hello(int x) {
>         System.err.println("hello from Java. int: " + x);
>    }
>    public void hello(String x) {
>        System.err.println("hello from Java. string: " + x);
>     }
> }
>
> (ns expmeth.TestMe
>  (:gen-class
>   :extends expmeth.ClassA
>   :exposes-methods {hello helloSuper}))
>
> (defn -hello
>  ([this]
>     (.helloSuper this)
>     (println "hello from clojure!"))
>  ([this x]
>     (.helloSuper this x)
>     (println "hello from clojure..." x)))
>
> >
>

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