Luke Palmer wrote: > I don't follow your examples. What is the logic behind them? > > On 9/3/06, Mark Stosberg <[EMAIL PROTECTED]> wrote: >> Examples: >> Arguments (<1 2>) to signatures 1. (@a?) and 2. (@a) calls 2 > > For example, I would expect this one to be ambiguous, because the 1. > (@a?) sub introduces two different signatures, 1. () and 1. (@a). > When given <1 2>, 1. (@a) matches as well as 2. (@a), so it is > ambiguous.
Oops. Yes, I would call that a tie, too. >> Arguments (@a) to signatures 1. (@a?) and 2. (@a) IS TIE > > The only difference I can see between this and the one above is @a vs. > <1 2>, which ought to behave the same way, right? Yes. >> Note that the variant /with/ the parameter can be considered an exact >> match, but but the variant /without/ it cannot be considered an exact >> match. > > And I expect that if either or both matches the method is considered > to be a match. Right? Let's look again at the last example: Arguments () to signatures 1. (@a?) and 2. () calls 2 (@a?) really means () OR (@a). The "()" implicit in (@a?) is a match, but not an exact match, so the "()" declared by itself wins, because it /is/ an exact match. Mark