Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: jhf@hex.no
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Possibility of Nested Classes and Nested Inheritance?
Date: Fri, 17 Dec 2004 10:31:41 +0900 (JST)	[thread overview]
Message-ID: <20041217.103141.126570250.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <20041216145907.GB5599@hex.no>

From: "Jørgen Hermanrud Fjeld" <jhf@hex.no>

> I just read about the work by Nystrom, Chong and Myers on nested
> inheritance, specifically the article "Scalable Extensibility via Nested
> Inheritance".
> 
> The article does demonstrate fascinating, to me, use of inheritance, and
> I wonder if it is possible to do something similar and
> object-oriented in OCaml.
> 
> To do something similar would, according to my understanding, require
> both inner classes and super-class polymorphism.
> In understand inner classes as implicitly polymorphic with respect
> to the enclosing class,
> and polymorphism on the super class as the practical ability to extend
> the type hierarchy upwards.
> 
> Do you know of any work that relate nested inheritance to OCaml, or that
> address the similar issuesof inner classes and super-class polymorphism?

Answer 1: there are no inner classes in ocaml.
Answer 2: there are plenty of other ways to obtain similar effects.

I don't know exactly what fascinated you in the paper, so it is hard
to answer precisely, but there are already a few techniques in ocaml to
solve the problems they describe.
(Of course they wouldn't cite them, as ocaml doesn't look like a
relevant language to them.)

Their compiler example seems to be a variant of the expression
problem.
There are several solutions to the expression problem in ocaml, using
either polymorphic variants
  http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/papers/fose2000.html
or objects
  http://pauillac.inria.fr/~remy/work/expr/

On the more general question of virtual types, Didier Rémy and Jérôme
Vouillon gave a detailed "refutation".
  http://pauillac.inria.fr/~remy/work/virtual/

So you can see if you can do all what you need with the above methods.
If you find some unexpected limitation, please let us now.

Jacques Garrigue


  parent reply	other threads:[~2004-12-17  1:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-16 14:59 Jørgen Hermanrud Fjeld
2004-12-16 21:50 ` [Caml-list] " John Prevost
2004-12-17  1:31 ` Jacques Garrigue [this message]
     [not found] <20041217184433.GA1036@balm.cs.cornell.edu>
2004-12-24 19:48 ` Nate Nystrom
2004-12-25  0:26   ` skaller
2004-12-25 10:59   ` Jacques Garrigue
2004-12-27  2:24   ` 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=20041217.103141.126570250.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@yquem.inria.fr \
    --cc=jhf@hex.no \
    /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