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 AAA22605; Wed, 24 Mar 2004 00:43:21 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 AAA22201 for ; Wed, 24 Mar 2004 00:43:20 +0100 (MET) Received: from smtp.mbg.ocn.ne.jp (mbg.ocn.ne.jp [210.190.142.181]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2NNhGHd014381 for ; Wed, 24 Mar 2004 00:43:17 +0100 Received: from localhost (p22052-adsau12honb7-acca.tokyo.ocn.ne.jp [220.99.26.52]) by smtp.mbg.ocn.ne.jp (Postfix) with ESMTP id 2249359CD; Wed, 24 Mar 2004 08:43:15 +0900 (JST) Date: Wed, 24 Mar 2004 08:43:00 +0900 (JST) Message-Id: <20040324.084300.18291498.yoriyuki@mbg.ocn.ne.jp> To: kknowles@berkeley.edu Cc: alex@baretta.com, caml-list@inria.fr Subject: Re: [Caml-list] Delegation based OO From: Yamagata Yoriyuki In-Reply-To: <20040323002926.GA30057@kefka.frap.net> References: <405EBD5D.1000406@baretta.com> <20040323.080154.71097954.yoriyuki@mbg.ocn.ne.jp> <20040323002926.GA30057@kefka.frap.net> X-Mailer: Mew version 2.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 yamagata:01 yoriyuki:01 yoriyuki:01 knowles:99 caml-list:01 2004:99 strictness:01 coerced:01 yamagata:01 inherit:01 inherit:01 int:01 int:01 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 341 From: Kenneth Knowles Subject: Re: [Caml-list] Delegation based OO Date: Mon, 22 Mar 2004 16:29:26 -0800 > This is a type error, just as if you override a class method with one of a > different type: > > # class x = object method y = 3 end;; > class x : object method y : int end > # class y = object inherit x method y = 4 end;; > class y : object method y : int end > # class z = object inherit x method y = "hello" end;; > This expression has type string but is here used with type int > > The same strictness could be applied to delegation. There is a difference. You cannot hide the method "y" in the class definition "x". An object can be coerced to a super type, so that it's type would forget about the method "y", then you override it... -- Yamagata Yoriyuki ------------------- 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