caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: james woodyatt <jhw@wetware.com>
To: The Caml Trade <caml-list@inria.fr>
Cc: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Subject: Re: [Caml-list] wish for something like 'restricted' methods
Date: Wed, 23 Mar 2005 00:22:23 -0800	[thread overview]
Message-ID: <d689b346ab537f692551c446033dfbdd@wetware.com> (raw)
In-Reply-To: <20050323.140312.78769966.garrigue@math.nagoya-u.ac.jp>

On Mar 22, 2005, at 9:03 PM, Jacques Garrigue wrote:
>
> Reading the remainder of your mail, I couldn't understand your notion
> of restricted method.

Looking at the literature you referenced, it would appear that I am 
asking for something that better supports "friend" relationships.  My 
notion is not well-formed.  (No surprise: I am not formally trained.)

> Jerome Vouillon (the original implementor of the ocaml object system)
> wrote a paper about using views to allow arbitrary hiding of methods.
>
>  Combining subsumption and binary methods: An object calculus with 
> views
>  In Proceedings of the 28th ACM Conference on Principles of Programming
>  Languages, pages 290\u2013303, 2001
>
> This may be related to what you want. However there is no plan to
> include views in ocaml.

I downloaded this paper from Portal (I am a SIGPLAN member) and studied 
it carefully.  I'm pretty sure I followed the math without getting 
lost.  The paper appears to cover *exactly* the problem that concerns 
me-- for precisely the reasons mentioned in its introductory section.  
My notion of "restricted" methods is a somewhat limited subset of what 
his "views" describe more generally.

[ From the paper referenced above by Jérôme Vouillon... ]
>>
>> Information hiding is of key importance for making programs more 
>> readable, secure and maintainable.  In particular, for abstraction 
>> purposes, one would expect to be able to specify freely what methods 
>> of a class are exported from a package (or a module) to the remainder 
>> of a program.  Furthermore, abstraction should not be impeded by the 
>> need for complex interaction between objects.  For instance, if 
>> objects from two different classes are to interact with one another, 
>> it should still be possible to hide the methods involved in the 
>> interaction.  This means that the objects must be able to communicate 
>> via methods not present in the interfaces exported by the classes to 
>> the rest of the program.  (A class or a function having such a 
>> privileged access to another class is commonly named a *friend*.)

This is what my wish is about.  Naturally, my enthusiasm is crushed by 
the time we reach the concluding paragraph.

[ Continuing from the conclusion of the referenced paper... ]
>>
>> Our calculus does not currently handle multiple inheritance.  We hope 
>> that multiple inheritance is possible even though this might require 
>> a significantly different semantics.  This is another important 
>> direction for future work.

Sigh.  I hope this work is continuing.

> On the other hand, I have just extended the ocaml type system to allow
> the use of private structural types, i.e. abstract types where you
> still allow access to some methods.

These are cool, but they do not satisfy my principle concerns.  The 
"views" thing seems like the best alternative I've seen so far.  Let me 
put more thought into what is my specific wish to see if I can imagine 
how to deal with the multiple inheritance problem.


--
james woodyatt <jhw@wetware.com>

  reply	other threads:[~2005-03-23  8:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 19:18 extending a functional updater implicitly publicizes sub-updater method? Marc Herbert
2005-03-22 19:56 ` [Caml-list] " Remi Vanicat
2005-03-22 23:34   ` wish for something like 'restricted' methods james woodyatt
2005-03-23  5:03     ` [Caml-list] " Jacques Garrigue
2005-03-23  8:22       ` james woodyatt [this message]
2005-03-30 13:16   ` private methods restricted to self? Marc Herbert
2005-03-31  2:30     ` [Caml-list] " Jacques Garrigue

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=d689b346ab537f692551c446033dfbdd@wetware.com \
    --to=jhw@wetware.com \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /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;
as well as URLs for NNTP newsgroup(s).