caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mathias Kende <mathias.kende@ens.fr>
To: Jean Krivine <jean.krivine@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Marshalling question
Date: Fri, 08 Oct 2010 15:48:06 +0200	[thread overview]
Message-ID: <1286545686.19478.40.camel@bohrium.pps.jussieu.fr> (raw)
In-Reply-To: <AANLkTikE_t9gDF0GojjytXyZwOZCdVy4chLt2xiVc_ge@mail.gmail.com>

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



  parent reply	other threads:[~2010-10-08 13:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-08 13:37 Jean Krivine
2010-10-08 13:39 ` [Caml-list] " David Allsopp
2010-10-08 13:48 ` Mathias Kende [this message]
2010-10-12  8:42   ` Alexey Rodriguez
2010-10-12  9:25     ` Julien Signoles
2010-10-12  9:26     ` Mathias Kende
2010-10-12  9:42       ` Julien Signoles
2010-10-12  9:48         ` Alexey Rodriguez
2010-10-09  7:58 ` forum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286545686.19478.40.camel@bohrium.pps.jussieu.fr \
    --to=mathias.kende@ens.fr \
    --cc=caml-list@inria.fr \
    --cc=jean.krivine@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).