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 453017F6D8 for ; Mon, 19 Jan 2015 09:56:58 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=pra; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=mailfrom; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mx20.yaziba.net) identity=helo; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="postmaster@mx20.yaziba.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8AAIPFvFRV6cyknGdsb2JhbABbzgSCTwKBIEMBAQEBAREBAQEBAQgLCQkULoQNAQU4QBELGAkWDwkDAgECAUUGAQwIAQGILM5iAQEIAQEBAR6QAIQpAQSXcIYvg2uIDgKEEYMxAQEB X-IPAS-Result: Aq8AAIPFvFRV6cyknGdsb2JhbABbzgSCTwKBIEMBAQEBAREBAQEBAQgLCQkULoQNAQU4QBELGAkWDwkDAgECAUUGAQwIAQGILM5iAQEIAQEBAR6QAIQpAQSXcIYvg2uIDgKEEYMxAQEB X-IronPort-AV: E=Sophos;i="5.09,425,1418079600"; d="scan'208";a="117571884" Received: from mx20.yaziba.net ([85.233.204.164]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 19 Jan 2015 09:56:56 +0100 Received: from mta10.int.yaziba.net (unknown [10.4.20.30]) by mx20.yaziba.net (mx10.yaziba.net) with ESMTP id 690711A73C9; Mon, 19 Jan 2015 09:56:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta10.int.yaziba.net (Postfix) with ESMTP id 70B3BCA684; Mon, 19 Jan 2015 09:56:55 +0100 (CET) X-Virus-Scanned: amavisd-new at mta10.int.yaziba.net Received: from mta10.int.yaziba.net ([127.0.0.1]) by localhost (mta10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WCbuCdBBKt9a; Mon, 19 Jan 2015 09:56:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta10.int.yaziba.net (Postfix) with ESMTP id 42B67CA734; Mon, 19 Jan 2015 09:56:55 +0100 (CET) X-Virus-Scanned: amavisd-new at mta10.int.yaziba.net Received: from mta10.int.yaziba.net ([127.0.0.1]) by localhost (mta10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id sgGRVwoDBYXh; Mon, 19 Jan 2015 09:56:55 +0100 (CET) Received: from [10.0.48.154] (unknown [185.23.92.144]) by mta10.int.yaziba.net (Postfix) with ESMTPSA id EEF19CA732; Mon, 19 Jan 2015 09:56:54 +0100 (CET) Message-ID: <54BCC6D6.6020702@frisch.fr> Date: Mon, 19 Jan 2015 09:56:54 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jun Furuse , oleg@okmij.org, caml-list References: <20150114084056.140F6C38A1@www1.g3.pair.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeejjedrjeehgddufecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffhfgfggfvufhfjggtgfesthejrgdttdefheenucfhrhhomheptehlrghinhcuhfhrihhstghhuceorghlrghinhesfhhrihhstghhrdhfrheq X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht X-Validation-by: alain.frisch@lexifi.com Subject: Re: [Caml-list] [ANN] ppx_monadic.1.0.2, ppx for monadic do, pattern On 01/18/2015 03:47 PM, Jun Furuse wrote: > Thanks, > > let! is not valid in the vanilla syntax therefore I guess you have > patched the compiler. > > Current OCaml syntax has shortage of pattern binding expression and > only usable is let%xxx p = e in which is a bit pain for ppx writers. If it's a pain, it's rather for users of ppx, no? Providing "alternative" forms of existing constructs (i.e. forms that look syntactically similar to these constructs) to be interpreted before they reach the type-checker, is indeed what extension nodes [%foo ...] were designed for. For expression constructs starting with a keyword, the short form KEYWORD%foo ... makes the use of extension nodes very cheap syntactically. I can appreciate that authors of tools that requires special syntactic support would love to have their new forms look completely native to users, but the counter-argument can be made that keeping an explicit syntax (through the '%' character) for features that are not part of the official language is a good property. (Camlp4/campl5 are still available for people who want to play with the concrete syntax.) With the short form, an alternative binding construct can be as short as: let%L p = e in .... I'm not suggesting to reserve one-letter extension identifiers for specific projects, but each tool could let the user choose explicitly which letter to use: [%%Project1 alt_id = "L"] [%%Project2 alt_id = "A"] ... ... let%L p1 = e1 in .... let%A p2 = e2 in .... Alain