Re: [Caml-list] What's the purpose of the static library?

2008-09-25 Thread bill yan
Hi Richard, Thanks a lot for your help on this topic. Now I have a quesiton for the following part: File: library.a and library.cmxa These files go together. The *.a file contains compiled native code in the normal system archive format. The *.cmxa file contains

Re: [Caml-list] What's the purpose of the static library?

2008-09-25 Thread Alain Frisch
bill yan wrote: By my understanding, unlike dlllibrary.so and liblibrary.a give user an option to choose compile dynamically or staticly, it seems for library.a, user can only choose static method. Does that mean compiled native code can only be staticly linked to user's application? In

[Caml-list] Default module type?

2008-09-25 Thread Christian Sternagel
Hi there, when I have a file m.ml I can use include M in other *.ml files to include the content of m.ml. However, the same functionality for module types seems not to exist. I have an interface file m.mli and want to use include M within another *.mli file (so that I only have to write

Re: [Caml-list] Default module type?

2008-09-25 Thread Ashish Agarwal
That is correct. You have to define a module type within an ml file, and then include that. See the following thread on the beginner's list. http://tech.groups.yahoo.com/group/ocaml_beginners/message/8992 However, I never did find out why. Why does the compiler not create a module type MySig from

[Caml-list] mutually dependent class and type

2008-09-25 Thread Sébastien Hinderer
Dear list, Is there a (clean) way to define simultaneously a class and a type that are mutually recursive ? Something like this : class element (c : content) = object ... end and type content = | Data of string | Elements of element list;; This is of course not a valid OCaml definition,

Re: [Caml-list] mutually dependent class and type

2008-09-25 Thread Martin Jambon
On Fri, 26 Sep 2008, Sébastien Hinderer wrote: Dear list, Is there a (clean) way to define simultaneously a class and a type that are mutually recursive ? I don't think so, but you don't have to. Something like this : class element (c : content) = object ... end and type content = | Data

[Caml-list] Re: mutually dependent class and type

2008-09-25 Thread Jeff Shaw
I don't know how you might directly get what you want, but here's one way to get an equivalent result. class element_aux (c : [`Data of string | `Element of element list]) = object end type content = Data of string | Element of element list;; let content_of_variant = function Data d - `Data