John Wilson schrieb: > On Dec 7, 2007 3:39 PM, Jochen Theodorou <[EMAIL PROTECTED]> wrote: > >> see above, in Groovy there is no need to do this. The reason you want to >> do this is because >> [...] >>> So, in Ng, e.foo(e) calls the method on E. >> if you say E#foo overwrites all older foo methods with the same number >> of parameters, then your problem is solved, or not? > > In Ng if the method dispatch logic finds a method with untyped > parameters then that method will be immediately called.
so you are not interested in letting Java do the same, ok. > This is > different to Groovy because the logic has to continue along the list > of methods looking for a "better" match. right. > I don't think either set of semantics is "wrong". Of course I prefer > the Ng semantics for the following two reasons: > > 1/ In general, it makes method dispatch faster because the search for > the appropriate method terminates early. true > 2/ I think of methods with untyped parameters as methods which will > accept all types of parameter. I find it hard to explain to a > programmer why, if he writes a method which will accept any type of > parameter, that method will not always be called. oh, this thought is not alien to me... I just think it does not fit Groovy much atm. bye blackdrag -- Jochen "blackdrag" Theodorou The Groovy Project Tech Lead (http://groovy.codehaus.org) http://blackdragsview.blogspot.com/ http://www.g2one.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---