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 TAA19591; Thu, 13 Sep 2001 19:39:37 +0200 (MET DST) 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 TAA21409 for caml-list@pauillac.inria.fr; Thu, 13 Sep 2001 19:39:36 +0200 (MET DST) 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 TAA19554 for ; Thu, 13 Sep 2001 19:33:14 +0200 (MET DST) Received: from smtp.noos.fr (racine.noos.net [212.198.2.71]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8DHXDP26937 for ; Thu, 13 Sep 2001 19:33:13 +0200 (MET DST) Received: (qmail 64216605 invoked by uid 0); 13 Sep 2001 17:33:13 -0000 Received: from unknown (HELO beaune.inria.fr) ([212.198.87.97]) (envelope-sender ) by 212.198.2.71 (qmail-ldap-1.03) with SMTP for ; 13 Sep 2001 17:33:13 -0000 Message-ID: <3BA0F11F.DE0303F1@beaune.inria.fr> Date: Thu, 13 Sep 2001 19:47:11 +0200 From: Didier Le Botlan Organization: INRIA Rocquencourt X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14-15mdk i586) X-Accept-Language: fr, en MIME-Version: 1.0 To: Patrick M Doane CC: caml-list@inria.fr Subject: Re: [Caml-list] Unbound type variables References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk What do you think of a parameterized class ? class ['a] c = object method m (x:'a) = match x with | `A -> () | `B -> () | `C -> () end class [[< `A | `B | `C] as 'b] c : object constraint 'b = 'b method m : 'b -> unit end Beware that the 'a parameter is freezed for each instance of the class, that is you cannot call method m twice on the same object with incompatible arguments. -- Didier Le Botlan http://cristal.inria.fr/~lebotlan ------------------- 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