<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/12/d8ad31ee763c42940b410290b1d27578"
  from="climb &lt;onlyclimb@1...&gt;"
  author="climb"
  date="2002-12-17T08:48:03"
  subject="[Caml-list] help recursive type"
  prev="2002/12/82e4b085cece1ac1bb93b992c7f2d862"
  next="2002/12/b0663d289638f7afc876e9898cb3915a"
  prev-thread="2002/12/d8bc2d637dcf77307c4ab81ceb0ea72f"
  next-thread="2002/12/dcb2f14b00717a17f23495f127b1c29d"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] help recursive type">
<msg 
  url="2002/12/d8ad31ee763c42940b410290b1d27578"
  from="climb &lt;onlyclimb@1...&gt;"
  author="climb"
  date="2002-12-17T08:48:03"
  subject="[Caml-list] help recursive type">
</msg>
</thread>

<contents>
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 -&gt; 'a -&gt; '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

</contents>

</message>

