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.2 required=5.0 tests=AWL,MAILTO_TO_SPAM_ADDR, 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 05D32BC0B for ; Sun, 14 Jan 2007 18:34:03 +0100 (CET) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.225]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0EHY2cR025359 for ; Sun, 14 Jan 2007 18:34:02 +0100 Received: by wr-out-0506.google.com with SMTP id 69so812427wra for ; Sun, 14 Jan 2007 09:34:01 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=izrQoLDg9rEO172Ht8spvGDD9MF5LiATkDeDVjQg6ECazh2Xa1tLSM2VSXNq4nDnw+2zmqH7m0ArTKKz6wMkMSyY4W0zkbrtbWX15mxF/PBi0OomntFtp2F1S2KpIzOqo6cd0wkwjqACtCdLPMcOEpg4tmkja8myJJpXGb+8zMs= Received: by 10.65.253.6 with SMTP id f6mr1857721qbs.1168796041426; Sun, 14 Jan 2007 09:34:01 -0800 (PST) Received: from ?192.168.0.18? ( [69.155.31.57]) by mx.google.com with ESMTP id c5sm4527517qbc.2007.01.14.09.34.00; Sun, 14 Jan 2007 09:34:00 -0800 (PST) Message-ID: <45AA6966.8010602@gmail.com> Date: Sun, 14 Jan 2007 11:33:26 -0600 From: Edgar Friendly User-Agent: Thunderbird 1.5.0.9 (X11/20061206) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocaml compiler features References: <45A87011.8080203@gmail.com> <53c655920701122341l3b95328clf4e9ee40d5656dde@mail.gmail.com> In-Reply-To: <53c655920701122341l3b95328clf4e9ee40d5656dde@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-j-chkmail-Score: MSGID : 45AA698A.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45AA698A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 foo:01 uncommon:01 ocaml:01 camlp:01 compiler:01 syntax:01 camlp:01 edgar:98 edgar:98 lowered:98 wrote:01 wrote:01 precedence:01 David Baelde wrote: > > On 1/13/07, Edgar Friendly wrote: >> >> I understand that the let statement groups the following compound >> >> expression into one statement for the then-clause, so it's a precedence >> >> problem. Would it really be enough to raise the precedence of ; higher >> >> than that of if/then? Is there any reason this hasn't been done already? > > > > It may be useful to note that some people might want to write code like: > > > > foo ; > > x <- if y then a else b ; > > bar ; > > > > In that example bar is really meant to be outside the if-then-else. > > I think this is the uncommon case, and deserves the parentheses: x <- (if y then a else b) ; > > OCaml has no such thing as statements, but only expressions. But let > > me use these words: you want a statement-level if-then-else with lower > > precedence than ";", it cannot be the same as this expression-level > > if-then-else with higher precedence than ";". 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? > > 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. 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. E.