Re: What databases have taught me
Date: 30 Jun 2006 08:39:09 -0700
Dmitry A. Kazakov wrote:
> On 30 Jun 2006 00:32:11 -0700, Marshall wrote:
> > What do multimethods buy you? If programmer x
> > entends the operations, and programmer y extends
> > the data types, who is going to write the code that
> > implements x's operator on y's data type? This problem
> > is a fundamental one; it cannot be solved by language
> > featues.
> It can. The language can statically require the developers to define all
> operations [slots in the dispatching table.] For multimethods it is
> statically enforceable. For full multiple dispatch it looks difficult.
Language features can statically *detect* the problem, but they can't fill in the matrix. At this point, only programmers can do that.
> I agree with you. IMO, it is a fundamental requirement on a *consistent*
> multiple dispatch.
> Side note: in a strongly typed language "extension" of an operation can be
> accomplished only through an "extension" of the type (actually a class of).
> This happens by adding a new type to the class, so that the operation
> extension be defined on that new type.
I believe you are descring OO here, yes?
> > I'm not familiar with the term "predicate dispatch" but as I
> > noted above, pattern matching is roughly the flipside of
> > OO's subtyping polymorphism.
> True. It does not add any safety, not even a feeling of.
Well, if you have closed variant types, it is possible for pattern matching to statically enforce that all variants are explicitly handled, which I think qualifies as *some* bit of safety. But no, it's not a huge thing.
Marshall Received on Fri Jun 30 2006 - 17:39:09 CEST