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 IAA26609 for caml-redistribution; Wed, 18 Dec 1996 08:29:17 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA17263 for ; Tue, 17 Dec 1996 17:06:22 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.12]) by nez-perce.inria.fr (8.7.6/8.7.1) with ESMTP id RAA21423 for ; Tue, 17 Dec 1996 17:06:21 +0100 (MET) Received: from vedette.ens.fr (vedette.ens.fr [129.199.130.1]) by nef.ens.fr (8.8.4/jtpda-5.1) with ESMTP id RAA09566 ; Tue, 17 Dec 1996 17:06:18 +0100 (MET) Received: from nave.ens.fr (nave.ens.fr [129.199.130.3]) by vedette.ens.fr (8.8.4/jb-1.1) id RAA16902 ; Tue, 17 Dec 1996 17:06:16 +0100 (MET) Received: from localhost (vouillon@localhost) by nave.ens.fr (8.8.4/jb-1.1) id RAA20299 ; Tue, 17 Dec 1996 17:06:15 +0100 (MET) X-Authentication-Warning: nave.ens.fr: vouillon owned process doing -bs Date: Tue, 17 Dec 1996 17:06:13 +0100 (MET) From: Jerome Vouillon X-Sender: vouillon@nave Reply-To: Jerome Vouillon To: Christian Boos cc: caml-list@inria.fr Subject: Re: Questions about class types In-Reply-To: <199612171154.MAA03264@arthur.u-strasbg.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis > Ok, I think I see now what's going on: the eventually hidden method would > be overwritten. That's because the hashing is on the method's name only, but > what if the name is extented by a stamp uniquely associated with the privacy > scope of the method ? > > i.e. one could have the classes: > > class a as self = | > val a = 1 | This is the "privacy scope" of class a. > | > private method toto = a | Inside this, the method's name could be > | expanded "toto-123" for example ... > method use = self#toto | > end | > > > class b as self = | > inherit a | > | > val b = "one" | This is another "privacy scope". > | > private method toto = b | Inside this one, the method's name could be > | expanded "toto-124". > method use = self#toto | Here, there is no way to access the former > end | method "toto" ... and therefore there's no > | conflict. > > Maybe this could work ? Right, one could indeed have private methods. But I am still looking for a good notation for private method invocation... The notation `self#toto' is not suitable (How would it be typed and compiled ? How do one know whether `toto' make reference to a regular or a private method ?). And I would not like writing just `toto', as this expression is somewhat misleading: it would not represent in this case a variable access, but a function call. Jerome