From: Xavier Leroy <Xavier.Leroy@inria.fr>
Subject: Re: local type within class
In-Reply-To: <3462F8B3.D1E@aar.alcatel-alsthom.fr> from Benoit Pasquereau at "Nov 7, 97 12:17:07 pm"
To: email@example.com (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