Larry wrote: > : > I strongly suspect that DbC and multimethods are, at best,. > : > orthogonal My gut level feeling is that multimethod calls look > : > like ordinary subroutine calls, and the "method" eventually > : > selected evaluates only its own PRE/POST conditions, which could > : > perhaps explicitly delegate to other PRE/POST conditions. If you > : > want more than that,you'll have to give me a PhD. :-) > : > : I thought I had ;) > : > : That is after all, one of the reasons why I'm a continuing > : contributor to the Damian Conway fund. > > And that is very much appreciated by all of us!
I'll say! ;-) And yes, I am thinking (deeply, I hope) about these issues. The first point to bear in mind is that multimethods do not enjoy the same well-ordered inheritance relationships that singly dispatched methods do. In fact, in the general case, it does not make sense to talk of one multimethod variant inheriting from another. A multimethod does not belong to a particular class (not even the one it happens to be defined in). Moreover, that definitional class plays no role in determining which variant of a multimethod is invoked on a particular set of arguments. I certainly agree that multiply dispatched subroutines should have PRE and POST blocks, but it I see no need to, means of, or sense in attempting to define relationships between variants that would permit inheritance of those constraints. As far as I am concerned, Larry's gut level reaction is spot on. Damian