English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2008-07-14 (14:38)
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:
> 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:


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

Best regards,