From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id C05537FCCB for ; Fri, 1 May 2015 22:14:24 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.223.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.223.174 as permitted sender) identity=mailfrom; client-ip=209.85.223.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f174.google.com) identity=helo; client-ip=209.85.223.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ie0-f174.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BoBQDo3UNVm67fVdFcg19cBYMYs2SOJoIHhgQCgU0HPBABAQEBAQEBEQEBAQEBBgsLCSEuQQODXQEBAwESER0BGxILAQMBCwYFBAcaHQICIgERAQUBChIGExIQh3QBAwkIDadXPjGLOYFrgnaIUQoZJwMKVYRDAQEBAQEBBAEBAQEBAQEBFAEFDosqhQEEB4JoL4EWBYUzCpA8hkCBIz2QTYIGEiOBDAmBA4MWPDGCRQEBAQ X-IPAS-Result: A0BoBQDo3UNVm67fVdFcg19cBYMYs2SOJoIHhgQCgU0HPBABAQEBAQEBEQEBAQEBBgsLCSEuQQODXQEBAwESER0BGxILAQMBCwYFBAcaHQICIgERAQUBChIGExIQh3QBAwkIDadXPjGLOYFrgnaIUQoZJwMKVYRDAQEBAQEBBAEBAQEBAQEBFAEFDosqhQEEB4JoL4EWBYUzCpA8hkCBIz2QTYIGEiOBDAmBA4MWPDGCRQEBAQ X-IronPort-AV: E=Sophos;i="5.13,352,1427752800"; d="scan'208";a="138562220" Received: from mail-ie0-f174.google.com ([209.85.223.174]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 May 2015 22:14:23 +0200 Received: by iecrt8 with SMTP id rt8so96221160iec.0 for ; Fri, 01 May 2015 13:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=c7Flr2ODB3b0SdFkHjDerSUEL1/ESG1z7tUfFbrIFzo=; b=Wb2rF72x+mPjos4321lWElB5n0ac7k03SCZE8+3KcMYepfpG2c0n4QbmgqHqJZez7q RDdroSR4Go8S7WWW+ZwgnqX6em2wFTqZJ1NUEj7QQf8FbJ/gdq1hOtwzGbD9CE44G+CG OHNsnL94Wlg1AyO1qUu/KEG/00QcyMR78N6iAKYhFvZsDzCZ/ba6NzvPt+2ydBRmsNQF Mtde4FIM4uPh54u6mWhLLJ7HAyQ6nFxjPdeh625y96Vukj6UabXhZorQlYzOPTC5fhh3 htMqtv7tEKCOVB2XIjqM1ctMs+Ug7bTCnlHUTmXzmaFTmdLgmEqEy9wQ3jb20x9fyiNh uPwQ== X-Received: by 10.107.129.229 with SMTP id l98mr14116929ioi.32.1430511262666; Fri, 01 May 2015 13:14:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.70.4 with HTTP; Fri, 1 May 2015 13:13:42 -0700 (PDT) In-Reply-To: <33523412539540019A672C80600DED12@erratique.ch> References: <33523412539540019A672C80600DED12@erratique.ch> From: Gabriel Scherer Date: Fri, 1 May 2015 22:13:42 +0200 Message-ID: To: =?UTF-8?Q?Daniel_B=C3=BCnzli?= Cc: Ocaml Mailing List Content-Type: multipart/alternative; boundary=001a113e56dca8954e05150adbb5 Subject: Re: [Caml-list] Safe UTF-8 string literals and pattern matching for OCaml --001a113e56dca8954e05150adbb5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I wonder whether a system based on extensions [%u "..."] rather than attributes "..." [@u] could be easier to extend in the future. For example, you might want to introduce a different annotation `u16` that generates an integer array representing an utf16-encoded literal (or an abstract type of your liking, but then not in pattern position). Having an annotation change the type of the code would not be very nice. On Fri, May 1, 2015 at 8:15 PM, Daniel B=C3=BCnzli wrote: > Hello, > > If you ever wanted to have that *safely* you may want to checkout this > experimental ppx: > > https://github.com/dbuenzli/ppx_utf8_lit > > Here's the design rationale: > > https://github.com/dbuenzli/ppx_utf8_lit#rationale > > Feedback welcome, > > Daniel > > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --001a113e56dca8954e05150adbb5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I wonder whether a system based on extensions [%u "..= ."] rather than attributes "..." [@u] could be easier to ext= end in the future. For example, you might want to introduce a different ann= otation `u16` that generates an integer array representing an utf16-encoded= literal (or an abstract type of your liking, but then not in pattern posit= ion). Having an annotation change the type of the code would not be very ni= ce.

On F= ri, May 1, 2015 at 8:15 PM, Daniel B=C3=BCnzli <daniel.buenzli@e= rratique.ch> wrote:
Hello,<= br>
If you ever wanted to have that *safely* you may want to checkout this expe= rimental ppx:

http= s://github.com/dbuenzli/ppx_utf8_lit

Here's the design rationale:

https://github.com/dbuenzli/ppx_utf8_lit#rationale

Feedback welcome,

Daniel



--
Caml-list mailing list.=C2=A0 Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--001a113e56dca8954e05150adbb5--