caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sarino Suon <doggreen@smoke.propagation.net>
To: caml-list@inria.fr
Subject: [Caml-list] Confused: The example on page 48 where (self :> c) does not work
Date: Thu, 31 May 2001 14:07:56 -0500 (CDT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0105311355070.562-100000@smoke.propagation.net> (raw)

Hi, all.

First, let me say that Ocaml is a wonderful language. Its typing
mechanism, though elaborate, appears to be robust, no matter how complex
by data structures become.

There's one problem that defies my understanding, though, and I hope
someone can help. 

I'm trying to understand the example on page 48 of the Ocaml release 3.00
documentation (PDF format). This was to show the case where omitting the
domain of a coercion does not work. Here's the example:

class virtual c = 
	object
		method virtual m:c
	end;;

class c' = 
	object (self) inherit c
		method m = (self :> c)       (* !!! *)
		method m' = 1
	end;;

I don't understand the explanation why the coercion would cause a problem, 
in particular
these two lines of the following paragraph: "On the other hand, in
expression (self :> c) the type of self and the domain of the coercion
above must be unified. That is, the type of the method m in
self (ie. c) is also the type of self. So, the type of self is
c.

It seems, at first blush, that the problem hinges on the special idea of
self-ness. But it seems more involved than this. Can someone help me?

Thank you.

--- Sarino
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


             reply	other threads:[~2001-06-01 17:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-31 19:07 Sarino Suon [this message]
2001-06-05 13:06 ` 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=Pine.LNX.4.21.0105311355070.562-100000@smoke.propagation.net \
    --to=doggreen@smoke.propagation.net \
    --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).