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 JAA05273; Tue, 17 Dec 2002 09:48:03 +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 JAA05268 for caml-list@pauillac.inria.fr; Tue, 17 Dec 2002 09:48:03 +0100 (MET) 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 JAA04119 for ; Tue, 17 Dec 2002 09:22:34 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from sm206.163.com ([202.108.44.206]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gBH8MEn05553 for ; Tue, 17 Dec 2002 09:22:22 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by sm206.163.com (Postfix) with SMTP id D1F161C74EDE0 for ; Mon, 16 Dec 2002 23:48:15 +0800 (CST) Received: from climbxp (unknown [159.226.149.121]) by 192.168.1.206 (Coremail) with SMTP id MZoFAL71/T2BApV5.2 for ; Mon, 16 Dec 2002 23:48:15 +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 23:48:15 +0800 Message-Id: <20021216154815.D1F161C74EDE0@sm206.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