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.0 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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id E574DBC69 for ; Fri, 11 May 2007 16:15:11 +0200 (CEST) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.244]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4BEFAPx026377 for ; Fri, 11 May 2007 16:15:11 +0200 Received: by an-out-0708.google.com with SMTP id c2so245331anc for ; Fri, 11 May 2007 07:15:10 -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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Y5ErHh3tr7G5w7UAYXRy+c/VWVjw8Xe0xt3Ce76HN7Hh9yvx16z+Mr1ek+zjQC4BVjlJazXIUk+ueOAR6+Jln0FT7jEwLYTtaZDwVr3b6CfR5vitmhNnuFGDTsL4gUkWPG6qKcljhkTpefMJtjRshAtqw92LR1vqeLHIwWEJLgg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=A0ay3mfUVk/0Cg6f+CCn3Pp0HduVbxLtYAd1G8kC0ES8+CcjuwL87bI1Lc3C2f2J8hU7UkTZg3GgkFuix9I6ISTwhDfsa0d91IgUpnUGcaYkl26t6WX9OBMnf+dCRD+iW7TPurqaDpTVgnQt0xXkJnrKf0XYLEW+a1YVjkhQGy8= Received: by 10.100.3.20 with SMTP id 20mr2223882anc.1178892909952; Fri, 11 May 2007 07:15:09 -0700 (PDT) Received: by 10.100.168.16 with HTTP; Fri, 11 May 2007 07:15:09 -0700 (PDT) Message-ID: <6f9f8f4a0705110715l48259b8cr11f22d333ed8d7f5@mail.gmail.com> Date: Fri, 11 May 2007 16:15:09 +0200 From: "Loup Vaillant" To: "Caml mailing list" Subject: Re: [Caml-list] Custom operators in the revised syntax In-Reply-To: <1884660607.20070511161455@moldavcable.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1884660607.20070511161455@moldavcable.com> X-j-chkmail-Score: MSGID : 46447A6E.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46447A6E.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 grebeniuk:01 syntax:01 infix:01 readable:01 readable:01 unreadable:01 shalom:98 imho:01 precedence:01 caml-list:01 dmitry:01 lisp:01 func:01 func:01 2007/5/11, dmitry grebeniuk : > Shalom, Nicolas. > > NP> Today it's about custom operators. In the original syntax everyone > NP> knows that's easy to define and use custom operators like ++, -->, > >>>>, +|, =?=, ... and as many as you want. > > As for me, the lack of custom infix operators in revised syntax > is a feature that allows to keep code clean, without any > "=?=" or "<<+". The code "(func arg1 arg2)" is imho much > more readable than "arg1 op arg2" because: 1. function name > usually says something about the meaning of the function, 2. you > don't need to remember operator's precedence and associativity > to understand the code. I remember a family of languages where (func x y) is the only syntax : Lisp. :) I tend to agree when one says custom operators are evil. However, when the default syntax uses operators, the custom ones are a net win : a wise programmer will use their semantic load carefully (big nums, for example), and sparsely, so the code is more readable. An unwise programmer will make the code unreadable anyway, regardless of the operators. Regards, Loup