Re: Naive, possibly silly question
From: Dave Harris (brangdon_at_cix.co.uk)
Date: 10/31/03
- Next message: Dave Harris: "Re: OO's best feature survey results"
- Previous message: Dave Harris: "Re: Naive, possibly silly question"
- Maybe in reply to: Dave Harris: "Re: Naive, possibly silly question"
- Next in thread: S Perryman: "Re: Naive, possibly silly question"
- Reply: S Perryman: "Re: Naive, possibly silly question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 21:27 +0000 (GMT Standard Time)
mfeathers@objectmentorNOSPAM.com (Michael Feathers) wrote (abridged):
> There is a statically typed prototype-based language called Omega, but
> even that uses inheritance to share behavior.
I am not sure what sharing behaviour has to do with type-checking or
message dispatch. They seem to be 3 different things, more or less
orthogonal.
> The root thing is that when you have a statically typed OO language, the
> compiler has to know whether an object can accept a particular message.
> So, every instance has to be traced back to a particular specification
> of behavior.
I am not sure what you mean here. What is the "particular specification of
behaviour" for something like:
template <typename T> T max( T a, T b ) { return a > b ? a : b; }
It's just invoking operator<() and hoping it does the right thing.
> I wouldn't count C++ templates, they are an entirely different kind of
> polymorphism.
Well, yes, but there's no reason why in some hypothetical language
something like the above couldn't be dispatched at run-time, using a
mechanism like Smalltalk's. Is there?
> I can imagine a statically-typed OO language that didn't use
> inheritance or delegation mimicking inheritance, but it would be
> pretty silly. Each instance would be a type and it would
> have its own method definitions.
Again you seem to be confusing reuse of method definitions with type
checking and/or polymorphism.
-- Dave Harris, Nottingham, UK
- Next message: Dave Harris: "Re: OO's best feature survey results"
- Previous message: Dave Harris: "Re: Naive, possibly silly question"
- Maybe in reply to: Dave Harris: "Re: Naive, possibly silly question"
- Next in thread: S Perryman: "Re: Naive, possibly silly question"
- Reply: S Perryman: "Re: Naive, possibly silly question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|