Object type inheritance (was: MRL questions)

Pablo Castells ([email protected])
Wed, 03 May 95 12:32:15 PDT

> Take as a running example for the questions in this section the following
> piece of mrl code:
>
> Object super_class {
> attribute foo : Double;
> }
>
> Object sub_class : super_class {
> ...
> }
>
> a) Two things are going on here. First, two objects (super_class and
> sub_class) are created. Now since sub_class inherits attributes from
> super_class, we want to know the relation between the actual objects
> super_class and sub_class. Is super_class a prototype object of
> sub_class? If the answer to this is "yes", then there are 2 ways
> to achieve prototype-instance behavior (one through mrl syntax and
> one through the create_object() method in the object system).

I think the idea we had in mind (at ISI) for object type inheritance was
fairly simple, the need for it coming basically from the convenience of
having object type hierarchies that would be taken into account when
type-checking, so that one could store different (sub)types of objects in
certain attributes. So, the effect of the above object type definitions
would just be that a) sub_class gets all the attribute declarations of
super_class, as if they were repeated inside the mrl definition of
sub_class (maybe some overriding should be allowed), and b) objects of type
sub_class can be stored in attributes declared as Object<super_class>.

Do we need more than that?

Pablo