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 IAA06448; Fri, 18 Jan 2002 08:15:24 +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 IAA06355 for ; Fri, 18 Jan 2002 08:15:23 +0100 (MET) Received: from slc02.smtp.stsn.com (p5.usslc14.stsn.com [12.23.74.5]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0I7FMj00532 for ; Fri, 18 Jan 2002 08:15:23 +0100 (MET) Received: from tet.kurims.kyoto-u.ac.jp ([10.4.203.30]) by slc02.smtp.stsn.com with Microsoft SMTPSVC(5.0.2195.3779); Fri, 18 Jan 2002 00:14:30 -0700 Received: from localhost (localhost [127.0.0.1]) by tet.kurims.kyoto-u.ac.jp (8.11.6/8.11.6) with ESMTP id g0I6nbH00757; Fri, 18 Jan 2002 15:49:37 +0900 (JST) (envelope-from garrigue@kurims.kyoto-u.ac.jp) To: warplayer@free.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] OO Interface In-Reply-To: <02fd01c19f96$548297c0$ac00a8c0@warp> References: <02fd01c19f96$548297c0$ac00a8c0@warp> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20020117224937B.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 17 Jan 2002 22:49:37 -0800 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-OriginalArrivalTime: 18 Jan 2002 07:14:30.0906 (UTC) FILETIME=[C5E2CDA0:01C19FEF] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "Warp" > If I got a parametrized class like : > > class p (x:int) (y:int) = > object(self) > val x = x > val y = y > method pos = (x,y) > rnd > > How do I write the correct interface for this class ? I can't figure out how > to specify the parameters type. Here is the interface, as the typechecker tells you, class p : int -> int -> object method pos : int * int val x : int val y : int end You can directly write it in the .mli. Or did you mean class type? Actually, this automatically defines the following class type, class type p = object method pos : int * int val x : int val y : int end Hope this helps, Jacques Garrigue ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr