On Oct 6, 7:45 am, Sylvain Joyeux <sylvain.joy... / polytechnique.org>
wrote:

> In my work, I *need* to reason about the types of my objects. They are not
> instances, they are instances of classes (=models) and I need to reason
> about those models. As soon as you're thinking that way, you *have* to
> have multiple inheritance because single inheritance is not enough.
>
> For now, I'm stuck with using modules to emulate some kind of multiple
> inheritance. It sucks.

No, you are stuck in a mindset and you have mapped that mindset onto
classes as though they are the only modelling tool available. There
are lots of other ways of modelling domains.

Classes in dynamic languages are just a convenient shorthand that
covers the general case very well. To be honest you could dump the
abstraction but it would mean more keyboard work.

You might want to consider whether using sets or states may be a
better way of modelling your domain. If you think a network is the
only model that will work, then you might want to brush up on your
graph theory and see if an edge/vector abstraction is suitable.
Clearly a simple tree isn't suitable (which is what a Class strcture
is).

First choose the correct data structure. If you find a model hard
always reconsider your data structure. It is very common to get the
wrong one, or try and shoehorn a model into the ones you are more
familiar with than learn how to use new ones.

Get your structure reviewed by a peer and try and keep an open mind.
There is nothing shameful about getting the wrong structure. We all do
it all the time.

NeilW