Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Hugo Ferreira <hmf@inescporto.pt>
To: Markus Mottl <markus.mottl@gmail.com>
Cc: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Escaped string in sexplib
Date: Tue, 08 Jun 2010 20:40:26 +0100	[thread overview]
Message-ID: <4C0E9CAA.3090205@inescporto.pt> (raw)
In-Reply-To: <AANLkTinKxgVIKN1BD59_K-J498cp1poxFGECJYK_OKU2@mail.gmail.com>

Markus Mottl wrote:
> On Tue, Jun 8, 2010 at 14:52, Hugo Ferreira <hmf@inescporto.pt> wrote:
>> My apologies but I did not explain myself correctly. The problem here is
>> that I am trying to automate the conversion to string of the data
>> structure read from the s-expressions. I have the following:
>>
>> let string_of_experiment_data data =
>>  let data = sexp_of_experiment_data data in
>>  Sexplib.Sexp.to_string_hum data
>>
>> The problem here is that the "to_string_hum" escapes certain characters,
>> but I need to have the strings "not escaped". So my question is: is
>> their any way I can tell sexplib to output a string but not escape
>> it? Otherwise I will have to hand encode this stuff 8-(
> 
> Sexplib does not support any other way of printing S-expressions.
> There would not be any reliable way to read back data without
> escaping.
> 
> If you want to write your own printers, this should still be very
> easy.  S-expressions are either a Sexp.Atom or Sexp.List.  It should
> only require a handful of lines to convert these to whatever other
> string representation you prefer.  Writing a corresponding parser may
> be more effort.
> 

Understood. I will avoid this.
I will stick to the solution I pointed out in my last e-mail

Once gain thanks.
Hugo F.


> Regards,
> Markus
> 


  reply	other threads:[~2010-06-08 19:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 15:44 Hugo Ferreira
2010-06-08 16:23 ` [Caml-list] " Paolo Donadeo
2010-06-08 19:10   ` Hugo Ferreira
2010-06-08 16:52 ` Markus Mottl
2010-06-08 18:52   ` Hugo Ferreira
2010-06-08 19:30     ` Hugo Ferreira
2010-06-09  7:39       ` Paolo Donadeo
2010-06-09  8:02         ` Hugo Ferreira
2010-06-08 19:36     ` Markus Mottl
2010-06-08 19:40       ` Hugo Ferreira [this message]
2010-06-08 19:42     ` Török Edwin
2010-06-09  6:40       ` Hugo Ferreira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C0E9CAA.3090205@inescporto.pt \
    --to=hmf@inescporto.pt \
    --cc=caml-list@yquem.inria.fr \
    --cc=markus.mottl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox