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: forum@x9c.fr <forum@x...>
Subject: Re: [Caml-list] Marshalling question

Le 8 oct. 2010 à 15:37, 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) ?

Well, you should have no problem with arrays or hash tables,
as long as they hold elements that are themselves marshallable.

To the best of my knowledge, marshalling is either not possible or unsafe with :
  - weak array, or weak hash table ;
  - exceptions ;
  - functional values in some settings (e. g. native compilation, use of "Dynlink"),
    and hence lazy values, streams, or any functional/imperative structure
    holding a closure.
Finally, I have some slight doubts regarding objects, and first-class modules
(they should be marshallable modulo the restrictions above, but never tested
this point).


Hope this helps,

Xavier Clerc