Hello

I am not sure I understand how this is supposed to work in BitC.

As I understand it there are structures which just include random
stuff and there are types which put requirements (specifically they
require methods to be present) on structures to which they can be
bound.

There is some sense in merging or extending the types. If you want an
argument passed to your code to have the traits of multiple types you
can explicilty bind it to multiple types but then you end up with what
appears to be multiple objects while they are in fact multiple views
of the same object.

This can be resolved by adding the ability to merge types so that you
can bind all the required interfaces in one place. I would not try to
call this inheritance and I specifically don't see why this would be a
case for *single* inheritance.

Single inheritance is very limited and since the types are something
that can be optimized away in the actual machine code and does not
require any storage of its own there is no need to resort to single
inheritance. Single inheritance is AFAIK a way to have inheritance in
place but avoid the issues of ordering storage for multiple ancestors,
especially if there is the same ancestor included multiple times, and
resolving the lookup order of methods.

Nothing like that appears here since the methods are on the struct and
it has its fixed layout no matter to how many types it is eventually
bound.

If the types allowed inferring new methods based on the requirements
they put on the struct this would be a different matter as the
inferred methods could clash then and the problems with lookup order
would apply.

Thanks

Michal
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to