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 CAA31284; Sat, 21 Sep 2002 02:34:38 +0200 (MET DST) 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 CAA31456 for ; Sat, 21 Sep 2002 02:34:37 +0200 (MET DST) Received: from leia.mandrakesoft.com (office.mandrakesoft.com [195.68.114.34]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8L0Ya514900 for ; Sat, 21 Sep 2002 02:34:36 +0200 (MET DST) Received: by leia.mandrakesoft.com (Postfix, from userid 505) id 8472841BB; Sat, 21 Sep 2002 02:31:52 +0200 (CEST) To: Alessandro Baretta Cc: Ocaml , Jacques Garrigue Subject: Re: [Caml-list] Polymorphic methods and ellipsis References: <3D8BBCC4.1080906@baretta.com> From: Pixel Date: 21 Sep 2002 02:31:52 +0200 In-Reply-To: <3D8BBCC4.1080906@baretta.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Alessandro Baretta writes: > I'm trying to write a polymorphic method that will accept as a parameter any > instance of any subclass of given class. For example what about the simpler: class salutation = object method greet : 'a. (#parent as 'a) -> string = fun obj -> obj # foo ^ obj # bar end which works :) ------------------- 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