Re: local type within class

From: Xavier Leroy (
Date: Wed Nov 12 1997 - 11:05:11 MET

From: Xavier Leroy <>
Message-Id: <>
Subject: Re: local type within class
In-Reply-To: <> from Benoit Pasquereau at "Nov 7, 97 12:17:07 pm"
To: (Benoit Pasquereau)
Date: Wed, 12 Nov 1997 11:05:11 +0100 (MET)

> I would like to define "types" that are in the namescope of classes, is
> it possibles in ocaml ? (just like local types in C++)

Namespace control in Caml is performed by the module system. Your
type belongs to a module (either the current compilation unit or some
sub-structure). To hide this type, just add an interface to this module
that does not specify this type.

Objective Caml classes are only intended as a mechanism to group sets
of methods, attach them to objects, and perform inheritance. Unlike
in C++ or Java, classes in Objective Caml do not double as a
general-purpose namespace control structure.

- Xavier Leroy

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:12 MET