Larry Wall wrote:
Jonathan Lang wrote:
: Trey Harris wrote:
: >All three objects happen to be Baz's, yes.  But the client code doesn't
: >see them that way; the first snippet wants a Foo, the second wants a Bar.
: >They should get what they expect, or Baz can't be said to "do" either.
:
: In principle, I agree; that's how it _should_ work.  I'm pointing out
: that that's not how things work in practice according to the current
: documentation.

The current documentation already conjectures this sort of disambiguation
at S12:996, I believe.

Right.  That _almost_ takes care of the issue; the only part left
untouched is what happens if you have two methods that can only be
disambiguated by the invocant's role, and you aren't told what the
role is.  For instance:

   class DogTree does Dog does Tree {
     method bark( Dog: ) { ... }
     method bark( Tree: ) { ... }
   }
   my DogTree $x;

   $x.bark();

In this example, what does the dispatcher do?

--
Jonathan "Dataweaver" Lang

Reply via email to