From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=MSGID_FROM_MTA_HEADER,X_IP autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 752E8BBCA for ; Sat, 22 Mar 2008 12:07:45 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtoAAKuF5EdKfS4ak2dsb2JhbACKToZDAQEBAQkFBwkUlwU X-IronPort-AV: E=Sophos;i="4.25,538,1199660400"; d="scan'208";a="24073169" Received: from yw-out-2122.google.com ([74.125.46.26]) by mail4-smtp-sop.national.inria.fr with ESMTP; 22 Mar 2008 12:07:45 +0100 Received: by yw-out-2122.google.com with SMTP id 7so1014659ywi.39 for ; Sat, 22 Mar 2008 04:07:44 -0700 (PDT) MIME-Version: 1.0 Message-ID: <20c787c8-b097-435c-99ef-28565f8b174a@z38g2000hsc.googlegroups.com> Date: Sat, 22 Mar 2008 04:07:43 -0700 (PDT) Received: by 10.142.200.20 with SMTP id x20mr733126wff.2.1206184063710; Sat, 22 Mar 2008 04:07:43 -0700 (PDT) In-Reply-To: X-IP: 88.163.179.251 References: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20060601 Firefox/2.0.0.8 (Ubuntu-edgy),gzip(gfe),gzip(gfe) Subject: Re: Sexplib question From: "berke.durak@gmail.com" To: a non Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; berke:01 durak:01 berke:01 durak:01 ocamlnet:01 sexp:01 sexp:01 foo:01 anon:98 threads:01 unbound:01 wrote:01 functions:01 define:02 define:02 On Mar 21, 8:31 pm, "a non" wrote: > Hi > > I have been following the threads about sexplib/deriving with interest and > have a question > about using sexplib with existing libraries. > > Example: If I want to use sexplib with values of type Netdate.t (a date type > from the ocamlnet > library) and try the following: > > type v = { name : string; created_at : Netdate.t} with sexp > > then I get the following error when compiling: > > Unbound value Netdate.t_of_sexp > > My question is, what is the easiest way to generate the sexp functions for > Netdate.t, without modifying the code of the Netdate library ? Just define a type alias for Netdate.t and define a printer for it, as in : type netdate = Netdate.t let sexp_of_netdate n = Atom "foo" let netdate_of_sexp = function Atom x -> ... type v = { name : string; created_at : netdate} with sexp -- Berke Durak