caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hendrik Tews <tews@irritatie.cs.kun.nl>
To: caml-list@inria.fr
Subject: Re: subtyping and inheritance
Date: Thu, 28 Jan 1999 20:40:48 +0100	[thread overview]
Message-ID: <199901281940.UAA01127@irritatie.cs.kun.nl> (raw)
In-Reply-To: <19990127151827.16711@pauillac.inria.fr>

Hi,

I don't know how method dispatch is implemented in ocaml. I was
also not able to find a reference about that (is their such?).
Therefore the following is based on some speculation.

   From: Jerome Vouillon <Jerome.Vouillon@inria.fr>
   Date: Wed, 27 Jan 1999 15:18:27 +0100
   Subject: Re: subtyping and inheritance
   
    [concerning covariant method specialization]
   
   However, it is not possible to apply this extension to Ocaml.  Indeed,
   it requires that methods are chosen depending on the dynamic type of
   their arguments.  But this information is not available in Ocaml.
   There are also difficulties for type inference.

But also in ocaml you choose the method depending on the dynamic
type of object to which it is applied (otherwise late binding
could never work). You only had to repeat this process for all
the arguments of the method which are declared for covariant
specialization. 

The absence of dynamic types applies only to arguments which are
not objects. But since other types (than object types) cannot be
related by the subtype relation, covariant specialization would
never apply for such arguments.

Surly, there would be some difficulties to integrate this
feature. But compare that with the gain! Compare those clumsy
solutions to Markus' problem with the ease of simly overriding
the binary method! Being able to really use binary methods in a
type safe environment would IMHO be worth a lot of effort.

Bye,

Hendrik




  parent reply	other threads:[~1999-01-28 20:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-11 18:52 Markus Mottl
1999-01-15 15:02 ` Jerome Vouillon
1999-01-15 17:37   ` Markus Mottl
1999-01-18 19:55     ` Jerome Vouillon
1999-01-18 21:18       ` Markus Mottl
1999-01-20 11:50         ` Hendrik Tews
1999-01-25  0:08           ` Markus Mottl
1999-01-25 15:06             ` Musings on Obj.magic (Was: subtyping and inheritance) David Monniaux
1999-01-27 14:18             ` subtyping and inheritance Jerome Vouillon
1999-01-27 14:45               ` Markus Mottl
1999-01-28 19:40               ` Hendrik Tews [this message]
1999-01-27 14:28           ` Jerome Vouillon
1999-04-15 12:18 Giuseppe Castagna
1999-04-15 16:02 ` Markus Mottl
1999-04-20 12:38 ` Didier Remy
1999-04-20 15:06   ` Giuseppe Castagna
1999-04-21 12:18     ` Didier Remy

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=199901281940.UAA01127@irritatie.cs.kun.nl \
    --to=tews@irritatie.cs.kun.nl \
    --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;
as well as URLs for NNTP newsgroup(s).