caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jan Rehders <wurstgebaeck@googlemail.com>
To: Alain Frisch <alain@frisch.fr>
Cc: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Beta release of ppx_string_interpolate, and help needed with ocamlfind/opam
Date: Tue, 28 Oct 2014 00:36:53 +0100	[thread overview]
Message-ID: <CAJwN6-1zAKr9Bzrxsx8MA-Nb-3JxHFt=5o+E5ReZLGFKezRWvw@mail.gmail.com> (raw)
In-Reply-To: <544E6C43.6090201@frisch.fr>

Alain: yes, for the new string literals this issue does not exist (and
they are already supported). But I'd like to keep support for regular
strings, too. I guess I could also simply expand something like
{istr|...|istr} but I think transforming anything that isn't in "my"
annotations is a bad idea.

Btw: anyone tried to use this with opam? I still couldn't get
ocamlfind to find the package after installation (see first mail).

On Mon, Oct 27, 2014 at 5:01 PM, Alain Frisch <alain@frisch.fr> wrote:
> On 10/26/2014 07:20 PM, Jan Rehders wrote:
>>
>> = Using \ instead of $ =
>> Using Swift style \(foo) instead of $(foo) would be nice but will
>> produce warnings from the lexer which I can't suppress w/o suppressing
>> all warnings about invalid escape sequences. Also this requires doing
>> this from the makefile so every user would have to do it. Is there
>> some API I’ve missed to suppress specific warnings on the code inside
>> [%str ..] from ppx filters?
>
>
> You might want to use the new syntax for string literals:
>
>   {| .... |}
>
> or:
>
>   {id| .... |id}
>
> (for an arbitrary id).  Contrary to regular string literals, OCaml doesn't
> apply any lexing convention to the string contents: what you have in the
> Parsetree is exactly the sequence of bytes from the source file.  This
> allows you to use you own conventions:
>
>    \(foo)
>
> Also, you can map in an exact way between from an index in the string to a
> location in the source code (in a regular string, you cannot distinguish
> \065 from A in the Parsetree, which makes this exact mapping impossible).
>
>
> Combined with an extension node, this would give:
>
>  [%str{| blabla \(x) blabla |}]
>
> -- Alain

  reply	other threads:[~2014-10-27 23:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-26 18:20 Jan Rehders
2014-10-27 16:01 ` Alain Frisch
2014-10-27 23:36   ` Jan Rehders [this message]
2014-10-28  8:18     ` Török Edwin
2014-10-28  9:13     ` Francois Berenger
2014-10-31 12:49       ` Jan Rehders

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='CAJwN6-1zAKr9Bzrxsx8MA-Nb-3JxHFt=5o+E5ReZLGFKezRWvw@mail.gmail.com' \
    --to=wurstgebaeck@googlemail.com \
    --cc=alain@frisch.fr \
    --cc=caml-list@yquem.inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).