From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA02066; Fri, 1 Jun 2001 19:00:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA02361 for caml-list@pauillac.inria.fr; Fri, 1 Jun 2001 19:00:50 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA18724 for ; Thu, 31 May 2001 21:07:06 +0200 (MET DST) Received: from smoke.propagation.net (smoke.propagation.net [63.249.179.1]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f4VJ75f18887 for ; Thu, 31 May 2001 21:07:05 +0200 (MET DST) Received: from localhost (doggreen@localhost) by smoke.propagation.net (8.8.5/8.8.5) with ESMTP id OAA02752 for ; Thu, 31 May 2001 14:07:56 -0500 Date: Thu, 31 May 2001 14:07:56 -0500 (CDT) From: Sarino Suon To: caml-list@inria.fr Subject: [Caml-list] Confused: The example on page 48 where (self :> c) does not work Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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