On Fri, Aug 12, 2011 at 12:10:17PM +0200, Thomas Braibant wrote: > The solutions I can imagine are: > - either to define Space.t as a record/tuple that contains a space* > and an OCaml list of the bodies that have been added. This seems a bit > of a duplication of the underlying C library.
This is the way to do it. It's a pretty common problem (and a commonly overlooked problem IME), but you'll find it occurs in many C bindings. A couple of examples in libraries that I have been involved with: ocaml-libvirt (http://git.annexia.org/?p=ocaml-libvirt.git;a=summary) - The relationship between connections (owner) and domains (owned). ocamlode - Many objects are related, similar to your example. Rich. -- Richard Jones Red Hat -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
