From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA05690 for caml-redistribution; Wed, 12 Nov 1997 15:02:58 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA29770 for ; Wed, 12 Nov 1997 11:06:01 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.5) with ESMTP id LAA22004; Wed, 12 Nov 1997 11:05:12 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA29754; Wed, 12 Nov 1997 11:05:11 +0100 (MET) From: Xavier Leroy Message-Id: <199711121005.LAA29754@pauillac.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: pasquere@aar.alcatel-alsthom.fr (Benoit Pasquereau) Date: Wed, 12 Nov 1997 11:05:11 +0100 (MET) Cc: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis > 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