From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA15711 for caml-redistribution; Tue, 1 Jun 1999 17:19:57 +0200 (MET DST) 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 GAA09918 for ; Tue, 1 Jun 1999 06:48:12 +0200 (MET DST) Received: from graphics.lcs.mit.edu (graphics.lcs.mit.edu [18.24.2.30]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id GAA17136 for ; Tue, 1 Jun 1999 06:48:10 +0200 (MET DST) Received: from pigment.lcs.mit.edu (pigment.lcs.mit.edu [18.24.2.83]) by graphics.lcs.mit.edu (8.9.0/8.9.0) with ESMTP id AAA08706; Tue, 1 Jun 1999 00:44:23 -0400 (EDT) Received: from localhost (b-db@localhost) by pigment.lcs.mit.edu (8.9.0/8.9.0) with SMTP id AAA06615; Tue, 1 Jun 1999 00:44:22 -0400 (EDT) Date: Tue, 1 Jun 1999 00:44:22 -0400 (EDT) From: Benoit deBoursetty To: Olivier Chararas cc: caml-list@inria.fr Subject: Re: OCAML parametric class coercion In-Reply-To: <37519E82.7D14@cnam.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis On Sun, 30 May 1999, Olivier Chararas wrote: > # class ['a] truc(init,(dev:'a)) = > object(self) > method essai = 1 > end > ;; > class ['a] truc : 'b * 'a -> object method essai : int end > # > class ['a] bidu1((dev:'a)) = > object(self) > method rate(untruc) = untruc#essai > end > ;; > Some type variables are unbound in this type: > class ['a] bidu1 : 'a -> object method rate : < essai : 'b; .. > -> 'b > end > The method rate has type < essai : 'a; .. > -> 'a where .. is unbound > # > class ['a] bidu2((dev:'a)) = > object(self) > method rate(untruc:truc) = untruc#essai > end > ;; > The type constructor truc expects 1 argument(s), > but is here applied to 0 argument(s) Ben ca, ca marche, je ne sais pas si c'est ce que tu cherches... This works, I don't know if it's what you were looking for... class ['a] bidu1((dev:'a)) = object(self) method rate(untruc : 'a truc) = untruc#essai end;; Benoit de Boursetty Benoit.de-Boursetty@polytechnique.fr