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 SAA22660; Fri, 1 Feb 2002 18:20:59 +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 SAA10721 for ; Fri, 1 Feb 2002 18:20:58 +0100 (MET) Received: from CS.UniBO.IT (leporello.cs.unibo.it [130.136.1.110]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g11HKv528135 for ; Fri, 1 Feb 2002 18:20:57 +0100 (MET) Received: from marcello.cs.unibo.it (root@marcello.cs.unibo.it [130.136.2.29]) by CS.UniBO.IT (8.9.3/8.9.3/Debian 8.9.3-6) with ESMTP id SAA23904; Fri, 1 Feb 2002 18:20:57 +0100 Received: (from sacerdot@localhost) by marcello.cs.unibo.it (8.9.3/8.9.3/Debian 8.9.3-21) id SAA05582; Fri, 1 Feb 2002 18:20:57 +0100 Date: Fri, 1 Feb 2002 18:20:57 +0100 From: Claudio Sacerdoti Coen To: Laurent Vibert Cc: caml-list@inria.fr Subject: Re: [Caml-list] Recursive classes and subtyping Message-ID: <20020201182057.C5484@cs.unibo.it> References: <20020201161256.B5286@cs.unibo.it> <20020201180117.A5484@cs.unibo.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020201180117.A5484@cs.unibo.it>; from sacerdot@CS.UniBO.IT on Fri, Feb 01, 2002 at 06:01:17PM +0100 X-Operating-System: Debian GNU/Linux X-Organization: Department of computer science, University of Bologna, Eurpean Union Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > It works, thanks!!! Obviously, I was a bit too quick! I think that the trick works only up to the point where the mutual recursion is fake. This is a slightly more complex example: # type -'a t;; # let f (x : [> `A] t) = (x : [`A] t);; # class c (newd : [> `A] t -> d) (obj : [> `A] t) = object method d = newd (f obj) end and d (newc : [> `A] t -> c) (obj : [> `A] t) = object method c = newc (f obj) end ;; class c : ([ `A] t -> d) -> [ `A] t -> object method d : d end class d : ([ `A] t -> c) -> [ `A] t -> object method c : c end I leave it for the real ocaml gurus! Regards, C.S.C. -- ---------------------------------------------------------------- Real name: Claudio Sacerdoti Coen PhD Student in Computer Science at University of Bologna E-mail: sacerdot@cs.unibo.it http://caristudenti.cs.unibo.it/~sacerdot ---------------------------------------------------------------- ------------------- 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