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
oo type question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-03-10 (08:42)
From: Michael Wohlwend <micha-1@f...>
Subject: Re: [Caml-list] oo type question
Am Montag, 10. März 2008 09:20:43 schrieb Jacques Garrigue:

ok, thanks for the explanations,

> From: Michael Wohlwend <micha-1@fantasymail.de>
> A small remark yet: in interfaces (and class types) it is ok to write
>   class c : object
>     method add : #someClass -> ...
>   end
> Here it is automatically assumed that the type variable is bound at
> the method level.

ah o.k,  nice to know. I'll try that.
(I thought declaring something to be of type #class is similar to 
the "implenents" declaration in java, where you can pass objects without a 
cast to methods accepting arguments of that interface, which I find 
nice :-) )
I like the oncept of ocaml to make no implizit casts; only when using objects 
I think casting to an upper class (!) should be done automatically since it's 
one of the basic "features" of oo programming.