Date: Tue, 17 Dec 1996 17:06:13 +0100 (MET)
From: Jerome Vouillon <vouillon@clipper.ens.fr>
To: Christian Boos <boos@arthur.u-strasbg.fr>
Subject: Re: Questions about class types
In-Reply-To: <199612171154.MAA03264@arthur.u-strasbg.fr>
> 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