Doing it better 1999-05-27 c
###

> Putting my last point in more pragmatic terms, I have only rarely used
> union types in C, and then in the same spirit as I use assignment within
> expressions, simply because I can, and it makes things a little more
> efficient.
>
> Perhaps I'm missing something you want to do with unions in an OOP world,
> like multiple inheritance, but I would have thought that inheritance can
> be defined rather more tightly than a simple union, in such a way as to
> avoid these problems.
>
> Then again, I'm not convinced that multiple inheritance is a good thing; I
> think you're better off using a context model than an object model if you
> want that sort of thing.

I do want to use unions for inheritance, yes. A channel which carries a
sum is effectively a table of methods that can be called. Implementing a
channel as a branch table makes the analogy quite tight. But you're not
necessarily missing something.

How might it be defined more tightly? What is a context model?

Alistair

