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 JAA00459; Tue, 23 Mar 2004 09:51:20 +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 JAA00681 for ; Tue, 23 Mar 2004 09:51:19 +0100 (MET) Received: from mailhost.trusted-logic.fr (mailhost.trusted-logic.fr [194.250.150.5]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2N8pqKW021364 for ; Tue, 23 Mar 2004 09:51:53 +0100 Received: from wight.trusted-logic.fr (wight.trusted-logic.fr [192.168.1.210]) by mailhost.trusted-logic.fr (Postfix) with ESMTP id D0318173 for ; Tue, 23 Mar 2004 09:51:17 +0100 (CET) Received: from hoedic (hoedic.trusted-logic.fr [192.168.3.2]) by wight.trusted-logic.fr (Postfix) with SMTP id B9AB6713C0 for ; Tue, 23 Mar 2004 09:51:17 +0100 (CET) Message-ID: <00a401c410b4$c135c220$0203a8c0@hoedic> From: =?iso-8859-1?Q?Correnson_Lo=EFc?= To: "Ocaml" References: <405EBD5D.1000406@baretta.com> Subject: Re: [Caml-list] Delegation based OO Date: Tue, 23 Mar 2004 09:56:39 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 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 delegates:01 delegates:01 gui:01 functors:01 struct:01 compiler:01 sig:01 sig:01 modules:02 modules:02 objects:02 module:03 module:03 classes:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 322 This is a very interesting way of OO-programming. More over, it allows to fullly benefit from multi-inheritance: Suppose we have: class type a = object ... end class type b = object ... end Then: class a_and_b = object delegates [classtype to] a ; delegates [classtype to] b ; end I mainly found the requirement for such a delegation mechanism while looking at GUI system, where classes have in general a *lot* of methods that must be delgated by hand. >>From the compiler point of view, notice that such a delegation mechanism would be concistent with the one already existing for modules (and functors) thanks to the "include" statement: module type A = sig ... end module type B = sig ... end module A_and_B(mA : A)(mB : B) = struct include mA [ : A] ; include mB [ : B] ; end >>From an academic point of view, and looking for a beautiful symetry between objects and modules, such an delegation-based OO system would be a nice construction. Loic Correnson. ------------------- 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