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 XAA24272; Thu, 17 Jan 2002 23:33:00 +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 XAA24403 for ; Thu, 17 Jan 2002 23:32:59 +0100 (MET) Received: from c0mailgw05.prontomail.com ([209.185.149.10]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g0HMWwf03189 for ; Thu, 17 Jan 2002 23:32:59 +0100 (MET) Received: from c2web24 (209.185.149.10) by c0mailgw05.prontomail.com (NPlex 5.5.029) id 3C3E24990023819D for caml-list@inria.fr; Thu, 17 Jan 2002 14:26:03 -0800 X-Version: Informail 6.2.2073.0 From: "=?iso-8859-1?B?IyFG7KPpX18xs35+?= =?iso-8859-1?B?IDA9MrA=?=" Message-Id: Date: Thu, 17 Jan 2002 16:31:56 -0600 X-Priority: Normal Content-Type: text/plain; charset=iso-8859-1 To: caml-list@inria.fr Subject: Re: [Caml-list] OO Interface X-Mailer: Web Based Pronto Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk the easiest way to do it is to simply assign initial values to x and y: # class p (x:int) (y:int) =3D object(self) val x =3D 0 val y =3D 0 method pos =3D (x,y) end;; class p : int -> int -> object method pos : int * int val x : int val y : int end # let x =3D new p 5 7;; val x : p =3D # x#pos;; - : int * int =3D 0, 0 hope this helps.... file13 http://www.qlippoth.com/ ---- Begin Original Message ---- From: "Warp" Sent: Thu, 17 Jan 2002 21:34:14 +0100 To: "OCaml" Subject: [Caml-list] OO Interface If I got a parametrized class like : class p (x:int) (y:int) =3D object(self) =A0 =A0val x =3D x =A0 =A0val y =3D y =A0 =A0method pos =3D (x,y) rnd How do I write the correct interface for this class ? I can't figure out how to specify the parameters type. I don't want to, but perhaps I have to use a Module ? Thanks Warp ------------------- Bug reports: http://caml.inria.fr/bin/caml- bugs =A0FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list- request@inria.fr =A0Archives: http://caml.inria.fr ---- End Original Message ---- No 'Truth' until Silence!! The 777 Devils mail http://qlippoth.zzn.com= ____________________________________________________________ Get your own FREE Web and POP E-mail Service in 14 languages at http://= www.zzn.com. ------------------- 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