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
[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: Alessandro Baretta <alex@b...>
Subject: [Caml-list] Recovering masked methods
I have code similar to the following

class a =
object (self)
   method m = 1
   method n = "Hello!"

class b =
object (self)
   inherit a as super_a
   method m = 2

Now I would like to define a third class, inheriting from b. 
  I need this class to be able to access the definition of 
method m from class a, otherwise I would have to use "copy & 
paste", which is contrary to my programmer's ethics.

Ideally, I would like to write

class c =
object (self)
   inherit b as super_b

   method m =
     (* some_stuff *)
     super_b # super_a # m

Presently, this is not allowed. Is there any specific reason 
for this? Could such a feature be implemented in the future?


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: