Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Recovering masked methods
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Johan Baltié <johan.baltie@w...>
Subject: Re: [Caml-list] Recovering masked methods
> On Tue, 16 Jul 2002, Alessandro Baretta wrote:
> 
> > class a =
> > object
> >    ...
> > end
> > 
> > class b =
> > object
> >    inherit a
> >    ...
> > end
> > 
> > class c =
> > object
> >    inherit a as super_a through b as super_b { through 
> > <class> as <identifier> }*
> > ...
> > end
> > 
> 
> isn't multiple inheritance enougth for this ?
> 
> class c =
>   object
>     inherit a as super_a
>     inherit b as super_b
>     method m = super_a # m
>     (* other method are left unchanged *)
>   end

And if
 class c =
   object
     inherit a as super_a
     inherit b as super_b
   end

Which one "c#m" will call ?

By experiments c#m = b#m, but 
 class c =
   object
     inherit b as super_b
     inherit a as super_a
   end

means c#m = a#m....

I do not even know what kindda behavior a "virtual" will generate !
Is there any way to forbid such dangerous thing ?

Ciao

Jo
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners