Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jerome Vouillon <vouillon@clipper.ens.fr>
To: Christian Boos <boos@arthur.u-strasbg.fr>
Cc: caml-list@inria.fr
Subject: Re: Questions about class types
Date: Tue, 17 Dec 1996 17:06:13 +0100 (MET)	[thread overview]
Message-ID: <Pine.SUN.3.95.961217161441.20187A-100000@nave> (raw)
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





       reply	other threads:[~1996-12-18  7:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199612171154.MAA03264@arthur.u-strasbg.fr>
1996-12-17 16:06 ` Jerome Vouillon [this message]
1996-12-18 13:29   ` Private methods (was Re: Questions about class types) Christian Boos
1996-11-21 13:57 Questions about class types Hendrik Tews
1996-11-21 17:10 ` Christian Boos
1996-12-10 11:10   ` Hendrik Tews
1996-12-11 13:16     ` Jerome Vouillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.SUN.3.95.961217161441.20187A-100000@nave \
    --to=vouillon@clipper.ens.fr \
    --cc=boos@arthur.u-strasbg.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox