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=0.0 required=5.0 tests=AWL 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 E30FABC0B for ; Sun, 14 Jan 2007 19:25:17 +0100 (CET) Received: from pih-relay06.plus.net (pih-relay06.plus.net [212.159.14.133]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0EIPH9W021651 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sun, 14 Jan 2007 19:25:17 +0100 Received: from [80.229.56.224] (helo=[10.0.0.5]) by pih-relay06.plus.net with esmtp (Exim) id 1H6A2d-0000rX-PC for caml-list@yquem.inria.fr; Sun, 14 Jan 2007 18:25:16 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocaml compiler features Date: Sun, 14 Jan 2007 18:23:32 +0000 User-Agent: KMail/1.9.5 References: <45A87011.8080203@gmail.com> <53c655920701122341l3b95328clf4e9ee40d5656dde@mail.gmail.com> <45AA6966.8010602@gmail.com> In-Reply-To: <45AA6966.8010602@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701141823.32855.jon@ffconsultancy.com> X-Miltered: at concorde with ID 45AA758D.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 uncommon:01 ocaml:01 camlp:01 syntaxes:01 camlp:01 compiler:01 syntax:01 edgar:98 lowered:98 dictate:98 frog:98 wrote:01 parsed:01 On Sunday 14 January 2007 17:33, Edgar Friendly wrote: > I think this is the uncommon case, and deserves the parentheses: > x <- (if y then a else b) ; Not in a functional language, like OCaml, where you're composing expressions into programs. If you want to make a fair comparison you should at least start by quantifying how common each is, and whether or not your proposed change has knock on effects (e.g. cyclic precedences). > I think I'm arguing that the precedence of if/then/else is too high, and > maybe should be lowered. Of course this isn't a reasonable thing to > ask, because it'll likely break existing code. Anyone with a way to > have my cake and eat it too? Use camlp4 to create some more revised syntaxes. > > > If you're bored with > > > begin/end a good solution might be to define a new construct using > > > camlp4 instead of hacking the compiler. It's the good advice in > > > general for syntax problems. > > Writing things in camlp4 could help me, but won't improve the world of > ocaml. It will if you do something more productive with camlp4, like try...finally or ... > I want to compare the situation to TeX / LaTeX -- since you can > customize it so much, people fix what they don't like on their local > copy, but these improvements never make it upstream to improve the > situation for the world. > > I will agree that I am too eager to "fix" the compiler, and appreciate > the community's help in tempering my inexperience. But I'd like to help > ocaml become a better language, and this seems like a reasonable small > step to start on. I wouldn't call changing the precedence of "if" a small step... On a related note, current precedences dictate that this: string1^string2 :: list is parsed as: string1^(string2 :: list) which is useless. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists