|
 |
Darren New <dne### [at] san rr com> wrote:
> Warp wrote:
> > Darren New <dne### [at] san rr com> wrote:
> >> That's certainly part of it, but you don't need to support multiple
> >> inheritance in the same way C++ does it. Eiffel has multiple inheritance,
> >> garbage collection, and O(1) virtual dispatch. (That last would probably be
> >> quite difficult if you didn't compile everything at the same time, of course.)
> >
> > As I have mentioned before, you can cast an object pointer to an
> > incompatible type assuming that:
> Right. I'm not sure what that had to do with what I was saying.
Nothing. Not everything has to be a direct answer to what has been written.
It's chatter.
> I believe the mechanism relies on knowing at compile time what every class
> in the system will be.
You mean it doesn't support precompiled libraries? (Why does that seem to
be so common with "higher-level" languages?)
> > I wonder if Eiffel supports this as well.
> Eiffel lets you cast up and down the heirarchy. All methods are semantically
> virtual (even if the compiler optimizes them to direct jumps), so the fact
> that you're casting up and down doesn't make it "invalid". You can't cast a
> reference to an object to a type that isn't in that object's parent class
> heirarchy.
Does that mean "no"?
Note that in the case I was talking about you are not casting only up or
only down in the hierarchy. You are actually casting down and then up in one
go (in a multiple inheritance situation), without seeing any of the
intermediate classes directly.
--
- Warp
Post a reply to this message
|
 |