Jochen Theodorou wrote:

> ...
> anyway I will outline the process in Groovy:
> 
> 1) build a list of all methods with the name of the method we want to calls
> 2) remove the methods that are not valid for the call
> 3) if more than one method remains calculate the "method distance" 
> between the call and the method
> 4) the method with my minimum distance will be selected
> 5) if at the end I have two or more methods with the same minimum 
> distance I have to report an error
> ...

I hope that list gets used multiple times.  Otherwise it would be better 
performance-wise (particularly wrt garbage), at the expense of somewhat 
more convoluted code since we don't have continuations, to just search 
for the nearest match (with a flag for the multiple match condition) 
rather than building a list.

The important thing is to make sure that the prospective method list for 
every case is clearly specified and documented.  Ditto for the 
precedence calculation.

Jim


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

Reply via email to