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 NAA13626; Fri, 5 Dec 2003 13:56:53 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA12969 for ; Fri, 5 Dec 2003 13:56:51 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hB5Cun113846 for ; Fri, 5 Dec 2003 13:56:50 +0100 (MET) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2-20030924/3.7W) with ESMTP id VAA22337; Fri, 5 Dec 2003 21:56:42 +0900 (JST) To: henri.dubois-ferriere@epfl.ch Cc: caml-list@inria.fr Subject: Re: [Caml-list] coercing to a #-type In-Reply-To: References: X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20031205215733B.garrigue@kurims.kyoto-u.ac.jp> Date: Fri, 05 Dec 2003 21:57:33 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 coercing:01 jacques:01 henridf:01 lcavsun:01 coercing:01 subtyping:01 jacques:01 coerce:01 int:01 garrigue:01 garrigue:01 readable:01 henri:03 identical:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Henri Dubois-Ferriere > can coercing an object to a #-type ever change the type of the object? > > [i tried to come up with some instance where this would happen, but could > not, and on thinking about it i would guess that since a #-type is 'open', > it makes no sense to coerce to such a type.] What do you mean by "coercing"? If you mean (o :> #a), then indeed it is pointless, as it is just equivalent to (o : #a) (no subtyping is introduced). > A somewhat related question: > > class a = object method bla = 1 end > are the types > > #a > > and > > < bla : int; ..> > > equivalent? (in the sense that using on instead of the other will > always give identical results) Indeed they are equivalent. #a is just a convenience to make printed types more readable. Jacques Garrigue ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners