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 CAA13238; Tue, 23 Mar 2004 02:14:13 +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 CAA13528 for ; Tue, 23 Mar 2004 02:14:12 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2N1E8Hd027361 for ; Tue, 23 Mar 2004 02:14:10 +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 KAA20531; Tue, 23 Mar 2004 10:14:02 +0900 (JST) To: alex@baretta.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] Delegation based OO In-Reply-To: <405EBD5D.1000406@baretta.com> References: <405EBD5D.1000406@baretta.com> 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: <20040323101402E.garrigue@kurims.kyoto-u.ac.jp> Date: Tue, 23 Mar 2004 10:14:02 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) 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 jacques:01 baretta:01 baretta:01 delegates:01 jacques:01 explicitely:01 alex:01 alex:01 garrigue:01 garrigue:01 objects:02 objects:02 classes:03 object:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 315 From: Alex Baretta > Away from politics and back to the ordinary stuff... [...] > This allows us to extend the functionality of CLASSES. What about > extending the functionality of objects? > > class *type* does_something = object ... end > > class does_more (an_object:#does_something) = object > delegates an_object > ... > end > > This is very important to me because in my code I often use the concept > of proxy-object. 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 which clearly would get the same type. As always the main trouble is that it requires a new keyword... This is worth considering. 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