From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 60722BC57 for ; Sat, 9 Oct 2010 09:58:28 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlsBAGe9r0xbeRvhjmdsb2JhbACiVgEBAQEJCwgJDwUfuWqFRwQ X-IronPort-AV: E=Sophos;i="4.57,307,1283724000"; d="scan'208";a="80447934" Received: from 26.mail-out.ovh.net ([91.121.27.225]) by mail1-smtp-roc.national.inria.fr with SMTP; 09 Oct 2010 09:58:28 +0200 Received: (qmail 31824 invoked by uid 503); 9 Oct 2010 08:03:28 -0000 Received: from b7.ovh.net (HELO mail616.ha.ovh.net) (213.186.33.57) by 26.mail-out.ovh.net with SMTP; 9 Oct 2010 08:03:28 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 9 Oct 2010 09:58:27 +0200 Received: from 81-64-226-3.rev.numericable.fr (HELO ?192.168.0.10?) (forum%x9c.fr@81.64.226.3) by ns0.ovh.net with SMTP; 9 Oct 2010 09:58:25 +0200 Subject: Re: [Caml-list] Marshalling question Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=iso-8859-1 From: "forum@x9c.fr" In-Reply-To: Date: Sat, 9 Oct 2010 09:58:25 +0200 Cc: x9c Content-Transfer-Encoding: quoted-printable Message-Id: <45949581-8B9C-4E29-9308-33D7689C7F98@x9c.fr> References: To: caml users X-Mailer: Apple Mail (2.1081) X-Ovh-Tracer-Id: 2351160481863959328 X-Ovh-Remote: 81.64.226.3 (81-64-226-3.rev.numericable.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Spam: no; 0.00; marshalling:01 krivine:01 ocaml:01 arrays:01 hashtbl:01 arrays:01 hash:01 marshalling:01 hash:01 compilation:01 dynlink:01 caml-list:01 exceptions:01 unsafe:01 imperative:01 Le 8 oct. 2010 =E0 15:37, Jean Krivine a =E9crit : > Dear ocaml users, >=20 > 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