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=none 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 08A27BC0B for ; Mon, 15 Jan 2007 15:25:12 +0100 (CET) Received: from hades.snarc.org (hades.snarc.org [212.85.152.11]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0FEPBSW031690 for ; Mon, 15 Jan 2007 15:25:11 +0100 Received: by hades.snarc.org (Postfix, from userid 1000) id 2FD4C1B481; Mon, 15 Jan 2007 15:24:35 +0100 (CET) Date: Mon, 15 Jan 2007 15:24:35 +0100 To: Richard Jones Cc: Edgar Friendly , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocaml compiler features Message-ID: <20070115142434.GA1753@snarc.org> References: <45A87011.8080203@gmail.com> <20070115103556.GB12311@furbychan.cocan.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070115103556.GB12311@furbychan.cocan.org> X-Warning: Email may contain unsmilyfied humor and/or satire. User-Agent: Mutt/1.5.13 (2006-08-11) From: tab@snarc.org (Vincent Hanquez) X-Miltered: at concorde with ID 45AB8EC7.004 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 hmmm:01 caml's:01 cheers:01 pet:98 cvs:01 wrote:01 precedence:01 exception:01 caml-list:01 exceptions:01 parentheses:01 unsafe:01 int:01 On Mon, Jan 15, 2007 at 10:36:02AM +0000, Richard Jones wrote: > Hmmm .. changing the precedence of operators to avoid two parentheses ... > I don't think that's good. > > if y=1 then ( > let z = 2 in > print_int y; > print_int z; > ) else > print_string "not one" > > I will however add my own pet wish: a 'return' statement! It doesn't > have to break type safety -- you should only be allowed to 'return' a > type compatible with the ordinary return type of the function. The > alternative (using exceptions to jump out of code) is ugly, slow and > unsafe. I agree, I cannot think of a bad way to use it, and it would be more useful than having one more nested if then else or an exception mechanism. (the only problem I'm seeing if that people will use this return statement at the end of function) Xavier, if somebody does a patch to do that or some other useful feature, would that be considered for entering CAML's CVS ? (i.e. what are the rules for accepting a patch ?) Cheers, -- Vincent Hanquez