Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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?

> I'm wondering if there's a reason why one cannot inherit from
> immediate objects? (See description at:
> 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:

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

Best regards,