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 XAA02586; Fri, 31 May 2002 23:56:43 +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 XAA02497 for ; Fri, 31 May 2002 23:56:42 +0200 (MET DST) Received: from cs.bu.edu (cs.bu.edu [128.197.12.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4VLuf502002 for ; Fri, 31 May 2002 23:56:41 +0200 (MET DST) Received: from csa.bu.edu (zhudp@csa [128.197.12.3]) by cs.bu.edu (8.12.2/8.12.2) with ESMTP id g4VLufF2011282 for ; Fri, 31 May 2002 17:56:41 -0400 (EDT) Received: from localhost (zhudp@localhost) by csa.bu.edu (8.10.1/8.10.1) with ESMTP id g4VLubg23991 for ; Fri, 31 May 2002 17:56:38 -0400 (EDT) X-Authentication-Warning: csa.bu.edu: zhudp owned process doing -bs Date: Fri, 31 May 2002 17:56:37 -0400 (EDT) From: dengping zhu X-Sender: zhudp@csa.bu.edu To: Ocaml Subject: [Caml-list] recursive type declaration Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, all, I have to raise another question about recursive type in Ocaml. Now I want to define a type and a class, both of which are recursive defined as follows: ---------------- type ty1 = | Int of int | String of string | Class of typeClass class virtual typeClass = object method virtual typeCon : ty1 end;; ----------------- However, it does not work. I can use another way to solve it by define ty1 as 'a ty1. Besides this way, is there any method to solve it? What's more, what's the common way to define such types? Thanks, Dengping ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners