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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9D005BB9C for ; Fri, 6 Jan 2006 15:30:09 +0100 (CET) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.202]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k06EU8ke028910 for ; Fri, 6 Jan 2006 15:30:09 +0100 Received: by xproxy.gmail.com with SMTP id i27so2090337wxd for ; Fri, 06 Jan 2006 06:30:08 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pnpjm9OR4i8h9b86wc4ANs7tP+wMz/CgkWJHDSRdkIYvUbZOKGjIGTU9yMTlvVYn+sPT6PfzCqIeXnt6hQjjCUFQ0cfYhJEk2+iEuAu4j2+h7P69zjbTCbJZghNk/VmQzwAysDh0B9LTHEau7REnsQP1mtEjHR5RyKbUJEmV+CM= Received: by 10.70.25.16 with SMTP id 16mr2799112wxy; Fri, 06 Jan 2006 06:30:07 -0800 (PST) Received: by 10.70.56.9 with HTTP; Fri, 6 Jan 2006 06:30:07 -0800 (PST) Message-ID: Date: Fri, 6 Jan 2006 09:30:07 -0500 From: Markus Mottl To: Jonathan Roewen Subject: Re: [Caml-list] Pickling for OCaml? Cc: Erik de Castro Lopo , caml-list@yquem.inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20060106211605.6e0d2bd8.ocaml-erikd@mega-nerd.com> X-Miltered: at nez-perce with ID 43BE7EF0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; markus:01 mottl:01 markus:01 mottl:01 caml-list:01 ocaml:01 camlp:01 variants:01 ocaml:01 parsing:01 ocaml-values:01 syntax:01 wrote:01 polymorphic:01 marshal:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=INFO_TLD,RCVD_BY_IP autolearn=disabled version=3.0.3 On 1/6/06, Jonathan Roewen wrote: > > Will the Marshall module not do? > > Marshal is unsafe. Pickling is safe. I'd take pickling =3D) You could try our S-expression library, which uses CamlP4 to generate code for converting arbitrary extensionally defined (=3D sum and product types, polymorphic variants, records, types with type variables) OCaml-types to and from S-expressions: http://www.janestcapital.com/ocaml The library is safe and displays understandable error messages when parsing S-expressions. One can choose whether to print values in human-readable ways or in very compact machine-readable (somewhat human-readable) form. It's also very easy to write down OCaml-values in S-expression syntax, which makes it ideal for complex configuration files. Regards, Markus -- Markus Mottl http://www.ocaml.info markus.mottl@gmail.com