Luke Palmer wrote:

Austin Hastings writes:


Hmm. The text and examples so far have been about methods and this
seems to be about multi-methods. Correct me if I'm wrong ...


You're wrong. Consider my example, where via single inheritance we reach a
"layered" list of methods, each of which replaces the previous one in the
namespace (parent.method superseded by child.method). This is not
multi-dispatch -- the class of the object being dispatched determines the
method -- but I want to modify the dispatch chain so that some upstream
class' method is "ignored".



It's surely possible by modifying that class's DISPATCH.


Whether it should actually be in the language is up for debate. I'd say
that if you need to do this with any frequency whatsoever, you're not
thinking about roles right. A good example might be in order... :-)



Well, what if the two classes you want to inherit from weren't designed with roles in mind? For instance, there might be two CPAN modules that each have a dozen methods that you want to inherit, but they each have 1 that overlap whose conflict you want to easily resolve.

Besides, "the user is not thinking about XXX right" sounds like we
need to give a ++ to the pythonometer ;)

- Joe

Reply via email to