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 KAA02060; Tue, 23 Mar 2004 10:02:05 +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 KAA31191 for ; Tue, 23 Mar 2004 10:02:04 +0100 (MET) Received: from cantina.students.cs.unibo.it (cantina.students.cs.unibo.it [130.136.3.110]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2N923Hd017128 for ; Tue, 23 Mar 2004 10:02:03 +0100 Received: from fistandantilus.takhisis.org (cantina.students.cs.unibo.it [130.136.3.110]) by cantina.students.cs.unibo.it (Postfix) with ESMTP id F1311BFFC for ; Tue, 23 Mar 2004 10:02:02 +0100 (CET) Received: by fistandantilus.takhisis.org (Postfix, from userid 3148) id A1546274041; Tue, 23 Mar 2004 10:01:51 +0100 (CET) Date: Tue, 23 Mar 2004 10:01:51 +0100 From: Stefano Zacchiroli To: caml-list@inria.fr Subject: Re: [Caml-list] Delegation based OO Message-ID: <20040323090150.GA7965@fistandantilus.takhisis.org> Mail-Followup-To: caml-list@inria.fr References: <405EBD5D.1000406@baretta.com> <20040323101402E.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040323101402E.garrigue@kurims.kyoto-u.ac.jp> User-Agent: Mutt/1.5.5.1+cvs20040105i 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; bononia:01 caml-list:01 2004:99 0900,:01 jacques:01 foo:01 foo:01 bononia:01 alex:01 garrigue:01 bologna:03 wrote:03 zacchiroli:03 zacchiroli:03 unibo:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 324 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. I find Alex idea really cool, delegation is a widely used technique in OO programming but at the same time is painful to use because you have to write the pattern: method foo = delegate#foo method bar = delegate#bar ... Having to write delegate foo to delegate delegate bar to delegate ... is not a big improvement, whereas writing class type delegate_type = object method foo: ... method bar: ... ... end delegate delegate_type to an_object would really be an improvement. Cheers. -- Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/ If there's any real truth it's that the entire multidimensional infinity of the Universe is almost certainly being run by a bunch of maniacs. -!- ------------------- 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