Version française
Home     About     Download     Resources     Contact us    
Browse thread
Why can't immediate objects be extended?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Keiko Nakata <keiko@k...>
Subject: Re: [Caml-list] Why can't immediate objects be extended?
Hello.

> I'm wondering if there's a reason why one cannot inherit from
> immediate objects? (See description at:
> http://caml.inria.fr/pub/docs/manual-ocaml/manual005.html#ss:immediate-objects)
> Is it just a syntax problem because the 'inherit' keyword currently
> needs to take a class type, or is there a deeper reason?

I do not think it is a syntax problem.

Here is my understanding:
The type of a class and the type of an immediate object are essentially 
different. In other words, the self type of a class is open, thus extensible;
the self type of an immediate object is closed, thus not extensible. 

As written at:

http://caml.inria.fr/pub/docs/manual-ocaml/manual005.html#ss:immediate-objects)

the difference gives you different advantages; I suspect this is one reason. 

Best regards,
Keiko