Version française
Home     About     Download     Resources     Contact us    
Browse thread
Marshalling question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mathias Kende <mathias.kende@e...>
Subject: Re: [Caml-list] Marshalling question
Le vendredi 08 octobre 2010 à 15:37 +0200, Jean Krivine a écrit :
> Dear ocaml users,
> 
> A simple question: is it safe to marshalize a data structure that
> contains imperative elements (like arrays or hashtbl) ?

It's relatively safe to do so. The only thing is that if it is
unmarshalled in the process where it was marshalled you will still and
up with a new array or hashtbl.

Exception are some complex datastructure which may require additional
care when marshalled. An example of which are the graphs of the
ocamlgraph library (even the functional one), but there is none in the
standard library.

> I found the documentation of the Marshal module rather obscure to me.
> In particular it is not clear whether I should use the No_sharing
> flag.

This flag is never needed but there is cases where it is mandatory *not*
to use it (with cyclic data).

Mathias

> 
> Thank you!
> J
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs