Re: What databases have taught me
Date: Sat, 1 Jul 2006 11:22:00 +0200
On 30 Jun 2006 16:33:44 -0700, Keith H Duggar wrote:
> Marshall wrote:
>> Dmitry A. Kazakov wrote:
>>> N is a type, but in a different meaning (it still has
>>> some operations defined). But this type is different
>>> from one of (N, +). (N, *) is yet another type. (N, +,
>>> *) is a fourth type. You've god the idea, I think.
>> Okay. So if I have a type N, with a minimal set of
>> operators (just "successor") and another module extends N
>> with a + function, and a different module extends N with a
>> * function, then we have three different types of N, is
>> that correct? Have we broken interoperability between N
>> values coming from the three modules now? If not, in what
>> sense are they different types?
> > Or when I load your module and define an arbitrary function > on your type N have I now defined a new type? Of course not.
It is an interesting issue. The situation now is that languages distinguish "methods" and "subroutines". A method cannot be defined after some freezing point. For them the answer is yes, you have to define a new type to override such an operation. C++ example:
virtual Foo (); // That's a method of X }; // Freezing point
virtual Bar (); // Illegal
I don't like this distinction. Maybe it is possible to have a language with methods only.
> Which is why I think Dmitry's notion of type is somewhat > useless in a programming context.
Technically it is not a problem. You can consider, that each declaration of a function introduces an anonymous subtype [*]. Otherwise, in a typed system, you were unable to call such a function. I would be a type error.
- In my terms subtype S of T, is a type that inherits operations of T.
-- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.deReceived on Sat Jul 01 2006 - 11:22:00 CEST