From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 50BCFBC57 for ; Tue, 8 Jun 2010 21:30:52 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlIBAI43DkzVhjEYkGdsb2JhbACRf4tlcwEBAQEJCQwHEQMfv0WFFgSDZw X-IronPort-AV: E=Sophos;i="4.53,385,1272837600"; d="scan'208";a="52696235" Received: from ihsmtp02voda.lis.interhost.com (HELO ihsmtp02cons.lis.interhost.com) ([213.134.49.24]) by mail2-smtp-roc.national.inria.fr with ESMTP; 08 Jun 2010 21:30:51 +0200 Received: from [192.168.1.64] ([95.136.106.136]) by ihsmtp02cons.lis.interhost.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 8 Jun 2010 20:30:51 +0100 Message-ID: <4C0E9A6A.8090504@inescporto.pt> Date: Tue, 08 Jun 2010 20:30:50 +0100 From: Hugo Ferreira User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 Cc: Markus Mottl , caml-list Subject: Re: [Caml-list] Escaped string in sexplib References: <4C0E6561.20207@inescporto.pt> <4C0E9177.4080802@inescporto.pt> In-Reply-To: <4C0E9177.4080802@inescporto.pt> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Jun 2010 19:30:51.0439 (UTC) FILETIME=[1AD163F0:01CB0741] X-Spam: no; 0.00; ocaml:01 ocaml:01 camlp:01 camlp:01 syntax:01 struct:01 syntax:01 struct:01 sexp:01 sexp:01 markus:01 beginner's:01 bug:01 unescape:98 unescape:98 Hello, Hugo Ferreira wrote: > Hello, > snip... >> Btw., the escaping conventions are >> absolutely identical to the ones used by OCaml. >> > > I am aware of this as it is indicated in your documentation and > the ocaml tutorial site. I also searched for a means to "unescape" > the result from "to_string_hum", which would also work. However > I cannot find a String.unescape. This issue has already been pointed > out. A possible solution would be to use the old. > > Token.eval_string > > and I cannot seem to use the equivalent of the new camlp4. The > equivalent: > > open Camlp4.PreCast > open Syntax > let eval_string s = Camlp4.Struct.Token.Eval.string ~strict:() s > > does not compile (Error: Unbound module Camlp4.PreCast). > > Can anyone suggest a solution or correction? > After a correction to the ocamlbuild tags file the above works correctly. So now I have: open Camlp4.PreCast open Syntax let eval_string s = Camlp4.Struct.Token.Eval.string ~strict:() s let string_of_experiment_data data = let data = sexp_of_experiment_data data in let s = Sexplib.Sexp.to_string_hum data in eval_string s which does the job. Don't know if the hex-encoding strategy is better though. Regards, Hugo F. > TIA, > Hugo F. > > > > > > > >> Regards, >> Markus >> > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >