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 KAA04223; Tue, 23 Mar 2004 10:44:30 +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 KAA01551 for ; Tue, 23 Mar 2004 10:44:29 +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.12.10/8.12.10) with ESMTP id i2N9j1KW029675 for ; Tue, 23 Mar 2004 10:45:02 +0100 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 SAA00659; Tue, 23 Mar 2004 18:44:20 +0900 (JST) To: zack@bononia.it Cc: caml-list@inria.fr Subject: Re: [Caml-list] Delegation based OO In-Reply-To: <20040323090150.GA7965@fistandantilus.takhisis.org> References: <405EBD5D.1000406@baretta.com> <20040323101402E.garrigue@kurims.kyoto-u.ac.jp> <20040323090150.GA7965@fistandantilus.takhisis.org> 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: <20040323184419A.garrigue@kurims.kyoto-u.ac.jp> Date: Tue, 23 Mar 2004 18:44:19 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 jacques:01 bononia:01 2004:99 0900,:01 jacques:01 alex's:01 garrigue:01 garrigue:01 variant:02 wrote:03 zacchiroli:03 object:03 object:03 zack:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 326 From: Stefano Zacchiroli > On Tue, Mar 23, 2004 at 10:14:02AM +0900, Jacques Garrigue wrote: > > Note however that one needs to know more clearly which methods are to > > be delegated, so I would rather favor a notation like: > > > > class does_more an_object = object > > delegate does_something to an_object > > ... > > end > > Isn't enough to have a (closed) object type annotation for "an_object"? > In this way you would now exactly the signature of the object to which > you want to delegate without having to enumerate all of them. Looks like there is a misunderstanding here: in Alex's example, does_something was an object type. So yes, the above amounts to an object type annotation, and declares simultaneously all the methods included in the type. The idea is to have something similar to variant dispatch function #super_a as x -> ... | #super_b as x -> ... | #super_c as x -> ... 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