From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B3F07BC6B for ; Thu, 10 May 2007 22:55:05 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.224]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4AKt45e030828 for ; Thu, 10 May 2007 22:55:05 +0200 Received: by nz-out-0506.google.com with SMTP id l8so792641nzf for ; Thu, 10 May 2007 13:55:02 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=MZ/IeKUpwvqOZ5hdg1JJVyFuqkFmomxSdRHyOHOkK0AdTJolLBUvX8lia8CXT/shwUt6EU71YmqYvTR1laePfyQMovlzwE0OKj3eHtF6WNg7L1AhzHrmI3RxdJ2oPNbhOqyjjzowqLlUv6AP4KJaUKmD0Oqxr5iTLOva2UsGKDw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=uiO+g3FLPxOUHgOpGPVknn1ZEgbF3ReTa79HpYk9A5L1f4S/YpgJfvbuQBDEnrIPd493oqPyOy1WVoh36Xvpkjn5LrXspjL1ng/dpZhKKzBRXBc/bWmqPccTWeY5t4sZ7yln1j1aRS7EuZhYPAIZfhpXOQwux+Wh+RSKvtmbru8= Received: by 10.114.161.11 with SMTP id j11mr692782wae.1178830502538; Thu, 10 May 2007 13:55:02 -0700 (PDT) Received: by 10.114.183.4 with HTTP; Thu, 10 May 2007 13:55:02 -0700 (PDT) Message-ID: Date: Thu, 10 May 2007 22:55:02 +0200 From: "Nicolas Pouillard" To: "Caml List" , "Gerard Huet" , "Benoit Razet" Subject: Custom operators in the revised syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-j-chkmail-Score: MSGID : 464386A8.004 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 464386A8.004 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 syntax:01 parens:01 backslash:01 infix:01 parens:01 parsing:01 lexer:01 backslash:01 lexer:01 lambda:01 avoids:01 define:01 revised:02 revised:02 Hello, Again this message is about the revised syntax and it's negative points or useless distances with the original one. Today it's about custom operators. In the original syntax everyone knows that's easy to define and use custom operators like ++, -->, >>>, +|, =?=, ... and as many as you want. To declare them in the original syntax one needs parens: let ( =?= ) x y = ...;; In the revised syntax one use a backslash: value \=?= x y = ...; Why not... but in the revised syntax these new operators are not automatically infix or prefix or postfix, you have to make your own syntax extension. In practice I found it too heavy, unless you already have a custom syntax extension local to the project or something like that. However there is bad things with parens: - Not LL(1) when treating them in parsing - Spaces must be used for the `*' character to avoids starting comments. In fact when dealing them in the lexer that's ok. And the space issue is not too big. Concerning the fixity of these operators I've already changed it to have the same thing as the original syntax. Concerning the backslash, I want to restore the parens convention to declare them and then free the backslash character and make it available in the default lexer (useful for an ascii lambda for instance). As before, feel free to make comments on that (not really passionating) subject. Regards, -- Nicolas Pouillard