On Sat, Sep 20, 2008 at 11:05:34PM -0700, chromatic wrote: > On Saturday 20 September 2008 22:24:52 Chris Davaz wrote: > > > If it is the case that :method and :multi are incompatible, I am a bit > > surprised to see that in the Rakudo src directory: > > I said they're incompatible -- meant in terms of their semantics. I didn't > say they don't work together in some cases with our current implementation. > (They probably shouldn't.)
:method and :multi work just fine together -- at least within a single class. In fact, the various compilers in PCT (PAST::Compiler and POST::Compiler) rely on multiple dispatch working properly for methods. Where the semantics get a little weird is when a subclass defines a multimethod that overloads multimethods of the same name in the parent class -- in this case the subclass multimethod completely hides the parent class multimethod. Pm