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] Protected 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] Protected methods
I'm trying to get the semantics of protected methods of C++. 
I have a class with a method that is not meaningful for the 
outside world, but different instances of this class should 
be able to invoke this method on one another.

I need something like the following pseudocode:

class a =
   method protected m = ...
   method m2 (obj:a) = a # m

I understand this can be obtained by creating a container 
module for class a and restricting the type of a through the 
module signature. I read the manual but was unable to figure 
out the syntax to do this. Would anyone be so kind as to 
lend a hand?

Thank you very much.


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