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 CAA31078; Sat, 21 Sep 2002 02:17:22 +0200 (MET DST) 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 CAA31040 for ; Sat, 21 Sep 2002 02:17:21 +0200 (MET DST) Received: from athlon.baretta.com (host2-68.pool80116.interbusiness.it [80.116.68.2]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g8L0HKD23041 for ; Sat, 21 Sep 2002 02:17:20 +0200 (MET DST) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id 601C62724C; Sat, 21 Sep 2002 02:26:44 +0200 (CEST) Message-ID: <3D8BBCC4.1080906@baretta.com> Date: Sat, 21 Sep 2002 02:26:44 +0200 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: it, en MIME-Version: 1.0 To: Ocaml Cc: Jacques Garrigue Subject: [Caml-list] Polymorphic methods and ellipsis Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'm trying to write a polymorphic method that will accept as a parameter any instance of any subclass of given class. For example class parent = object method foo = "Hello " method bar = "World!" end class son = object inherit parent method buz = "Cheers" end class salutation : object method greet : 'a. (#parent as 'a) -> string end = object method greet obj = obj # foo ^ obj # bar end But of course, this does not work. What is problem? How can I get a method with a polymorphic ellipsis in its type? 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