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 QAA14156; Mon, 16 Dec 2002 16:23:01 +0100 (MET) 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 QAA13948 for caml-list@pauillac.inria.fr; Mon, 16 Dec 2002 16:23:00 +0100 (MET) 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 NAA09739 for ; Mon, 16 Dec 2002 13:55:51 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from sm212.163.com ([202.108.44.212]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gBGCtT929233 for ; Mon, 16 Dec 2002 13:55:36 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by sm212.163.com (Postfix) with SMTP id 4F0041C7B27CB for ; Mon, 16 Dec 2002 20:55:01 +0800 (CST) Received: from climbxp (unknown [159.226.149.121]) by 192.168.1.212 (Coremail) with SMTP id zpcBACPN/T2/AJV5.2 for ; Mon, 16 Dec 2002 20:55:01 +0800 (CST) From: "climb" To: "caml-list@inria.fr" Subject: [Caml-list] help recursive type X-mailer: Foxmail 4.2 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit Date: Mon, 16 Dec 2002 20:55:2 +0800 Message-Id: <20021216125501.4F0041C7B27CB@sm212.163.com> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dear caml-list I want to buidl a tree , so first i defined Node module Node= struct type 'a t = {id : int ; mutable anc : 'a t ; mutable child : 'a t array ; mutable content : 'a } let create i init = {id = i ; child = [||] ; content = init ; anc =????} .. end i dont know how to define the function var create : int -> 'a -> 'a t how to initiate anc ? but if in order to initiate anc easily , i define type 'a t = Empty | Some of { id :int ; mutable anc : 'a t .....} however syntex error :-( so, how to solve this problem? Thanks Yours climb onlyclimb@163.com 2002-12-16 ------------------- 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