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 LAA26893; Mon, 22 Mar 2004 11:17:44 +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 LAA26259 for ; Mon, 22 Mar 2004 11:17:43 +0100 (MET) Received: from alex.baretta.com ([213.255.109.130]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2MAHgHd012371 for ; Mon, 22 Mar 2004 11:17:42 +0100 Received: from baretta.com (localhost.localdomain [127.0.0.1]) by alex.baretta.com (8.12.8/8.12.8) with ESMTP id i2MAI5fA018227 for ; Mon, 22 Mar 2004 11:18:05 +0100 Message-ID: <405EBD5D.1000406@baretta.com> Date: Mon, 22 Mar 2004 11:18:05 +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: Ocaml Subject: [Caml-list] Delegation based OO Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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; baretta:01 baretta:01 delegates:01 protype:99 coolest:99 ocaml:01 caml:01 inherit:01 alex:01 alex:01 supported:01 match:02 objects:02 classes:03 object:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 304 Away from politics and back to the ordinary stuff... Presently Ocaml supports the following OO paradigm: class does_something = object .. end class does_more = object inherit does_something ... end 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. let prototype = match whatever with | ... as first_case -> new does_it_the_first_way | ... as second_case -> new does_it_the_second_way | ... as third_case -> new does_it_the_third_way class does_more prototype = object method one = prototype # one method two = protype # two ... end This is really a pain. I would expect delegation to be supported in the coolest OO language under the sun ;) O great Caml breeders, what do you say to this? 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