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 XAA12638; Wed, 5 Feb 2003 23:36:28 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA14208 for caml-list@pauillac.inria.fr; Wed, 5 Feb 2003 23:36:27 +0100 (MET) 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 WAA13053 for ; Wed, 5 Feb 2003 22:40:33 +0100 (MET) Received: from ariel.yandex.ru (ariel.yandex.ru [213.180.193.62]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h15LeWf13092 for ; Wed, 5 Feb 2003 22:40:32 +0100 (MET) Received: from YAMAIL (ariel.yandex.ru) by mail.yandex.ru id ; Thu, 6 Feb 2003 00:40:15 +0300 Date: Thu, 6 Feb 2003 00:40:15 +0300 (MSK) From: "inv2002" Reply-To: inv2002@yandex.ru Message-Id: <3E4184BF.000014.23165@ariel.yandex.ru> MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] To: caml-list@inria.fr Subject: [Caml-list] Problem with classes or i need help X-source-ip: 62.118.153.17 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I don't know correct solution of my problem. Here my example: ---begin 1.ml--- #!/usr/bin/env ocamltop class virtual figure () = object method virtual to_string: string end class triangle () = object inherit figure () method private to_string = "Triangle" method m1 = Random.float 5.0 end class circle () = object inherit figure () method private to_string = "Circle" method m2 = Random.int 6 end class screen () = object val mutable figures = [] method add_figure f = figures <- (f#to_string ) :: figures end let main () = let s1 = new screen () in s1#add_figure (new circle ()); s1#add_figure (new triangle ()) let () = main () --end--- [inv@localhost ~]$ ./1.ml File "./1.ml", line 22, characters 5-121: Some type variables are unbound in this type: class screen : unit -> object val mutable figures : 'a list method add_figure : < to_string : 'a; .. > -> unit 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. -- ------------------- 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