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 BAA16432; Thu, 6 Feb 2003 01:45:14 +0100 (MET) 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 BAA15831 for ; Thu, 6 Feb 2003 01:45:14 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h160iwP06394 for ; Thu, 6 Feb 2003 01:45:01 +0100 (MET) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id JAA09787; Thu, 6 Feb 2003 09:44:40 +0900 (JST) To: inv2002@yandex.ru Cc: caml-list@inria.fr Subject: Re: [Caml-list] Problem with classes or i need help In-Reply-To: <3E4184BF.000014.23165@ariel.yandex.ru> References: <3E4184BF.000014.23165@ariel.yandex.ru> 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: <20030206094439M.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 06 Feb 2003 09:44:39 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > class virtual figure () = > object > method virtual to_string: string > end [...] > class screen () = > object > val mutable figures = [] > method add_figure f = > figures <- (f#to_string ) :: figures > end [...] > The method add_figure has type < to_string : 'a; .. > -> unit where .. > is unbound > > I understand the problem, but i don't know solution, help, please. Are you sure you understood ?-) There's nothing in your program to tell the compiler that the argument to add_figure is supposed to be a figure. method add_figure (f : figure) = figures <- f#to_string :: figures Or, if you want to avoid coercions when calling #add_figure, method add_figure : 'a. (#figure as 'a) -> unit = fun f -> figures <- f#to_string :: figures 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