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: 2002-07-20 (23:53)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] Protected methods

Dmitry Bely wrote:
> Do not private Ocaml methods have in fact "protected" C++ semantics? They
> cannot be called directly but can be used in methods of inherited
> classes...
> - Dmitry Bely

I thought so, too. I made several atttempts, and the 
compiler seemed to reject all of them. Let me see if I can 
cook up a quick example.

# class a = object method private m : unit = (new a) # m end;;
The expression "new a" has type a = <  > but is used with type
   < m : unit; .. >
Only the second object type has a method m


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