From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 29E1BBB81 for ; Wed, 11 Jan 2006 05:50:52 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0B4opvD011900 for ; Wed, 11 Jan 2006 05:50:51 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id FAA21058 for ; Wed, 11 Jan 2006 05:50:51 +0100 (MET) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.199]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0B4oos0011896 for ; Wed, 11 Jan 2006 05:50:50 +0100 Received: by zproxy.gmail.com with SMTP id z3so68562nzf for ; Tue, 10 Jan 2006 20:50:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ehn0LrZvu7imoi3zye2TPxTNp7Ld2SByfYKpN8WpiF9XIp2G/lXYaeL5ToXa3BroRiM7aWOgGNWapNOKoIKJrq61e+pDx/wOn23ZdjLkFxVTtfjyagvkZ/zLfiyCPR2VWMmWEpod1jEh51uFKtNDQAJoGFEnHoc3O9ixIw8Op14= Received: by 10.65.186.10 with SMTP id n10mr77352qbp; Tue, 10 Jan 2006 20:50:50 -0800 (PST) Received: by 10.65.22.19 with HTTP; Tue, 10 Jan 2006 20:50:50 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2006 17:50:50 +1300 From: Jonathan Roewen Subject: Re: [Caml-list] Pickling for OCaml? Cc: caml-list@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> <43BE8E82.1000901@barettadeit.com> <20060106160207.GK5470@three-tuns.net> X-Miltered: at nez-perce with ID 43C48EAB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43C48EAA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 oops:01 mli:01 sml:01 o'caml:01 bool:01 char:01 combinators:01 seq:01 mli:01 ath:98 ath:98 pair:01 kernel: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.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 Oops, URLs are wrong =3D( Files at http://devnulled.ath.cx/svn/dst/trunk/kernel/pickle.ml & http://devnulled.ath.cx/svn/dst/trunk/kernel/pickle.mli > Well, in the meantime, we've ported most of the pickling library from > SML.NET to work with O'Caml. Supports most of the basic types > (int,bool,char,string,list,array,unit,pairs->sextuples) and a few > combinators (alttag, wrap, lift,seq). > > Fairly easy to define a pickler: > > module BytePickle =3D Pickle.CorePickle(Pickle.ByteCodec) > open BytePickle > > let pickler =3D pair (string list,int) > > let data =3D pickle pickler (["hello";"world"],-1) > > let value =3D unpickle pickler (List.rev data) > > Files at http://devnulled.ath.cx/svn/dst/kernel/pickle.ml & > http://devnulled.ath.cx/svn/dst/kernel/pickle.mli > > Kindest Regards, > > Jonathan >