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 IAA29005; Tue, 23 Mar 2004 08:27:21 +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 IAA29258 for ; Tue, 23 Mar 2004 08:27:20 +0100 (MET) Received: from alex.baretta.com ([213.255.109.130]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2N7RsKW009369 for ; Tue, 23 Mar 2004 08:27:54 +0100 Received: from baretta.com (localhost.localdomain [127.0.0.1]) by alex.baretta.com (8.12.8/8.12.8) with ESMTP id i2N7RgTd002348; Tue, 23 Mar 2004 08:27:43 +0100 Message-ID: <405FE6EE.3080202@baretta.com> Date: Tue, 23 Mar 2004 08:27:42 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: it, en-us, en MIME-Version: 1.0 To: Jacques Garrigue , Ocaml Subject: Re: [Caml-list] Delegation based OO References: <405EBD5D.1000406@baretta.com> <20040323101402E.garrigue@kurims.kyoto-u.ac.jp> In-Reply-To: <20040323101402E.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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; baretta:01 baretta:01 caml-list:01 jacques:01 delegating:01 checker:01 explicitely:01 explicitely:01 alex:01 alex:01 garrigue:01 objects:02 wrote:03 object:03 object:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 321 Jacques Garrigue wrote: > > Interesting idea. It would be even more useful now that one can define > immediate objects (without explicitely defining a class). > And recent changes on the implementation make direct delegation > very cheap in terms of code size. > 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 Ah! I see your point. Why not? Of course, delegating a class signature to an object allows you to define explicitely the type components which the type of does_more imports from the type of an_object. This would probably help the type checker a lot at giving sensible error messages. Alex ------------------- 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