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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id DA8FDBC0B for ; Tue, 16 Jan 2007 20:24:38 +0100 (CET) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0GJOcR2003963 for ; Tue, 16 Jan 2007 20:24:38 +0100 Received: by an-out-0708.google.com with SMTP id c24so1104765ana for ; Tue, 16 Jan 2007 11:24:37 -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:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=FBJpUEvsYfB7Nosund7vxSAck0kUM6VtqS25bqFHq0X7HOM87Q0lnAu7PDAWIb6UMxIH7GDTu2gxKenDQcYUBSwoWoedcKqAmyDgX67hkEZG2rb9GWpvlUqk18lGCWATCBhbxQn/d+YgU1/+Ip7XgdOj5YAQWnnx1I3QGwy1T/o= Received: by 10.65.192.16 with SMTP id u16mr8444281qbp.1168975477019; Tue, 16 Jan 2007 11:24:37 -0800 (PST) Received: from ?192.168.0.18? ( [69.155.31.57]) by mx.google.com with ESMTP id e15sm4257050qba.2007.01.16.11.24.35; Tue, 16 Jan 2007 11:24:36 -0800 (PST) Message-ID: <45AD2672.2090206@gmail.com> Date: Tue, 16 Jan 2007 13:24:34 -0600 From: Edgar Friendly User-Agent: Thunderbird 1.5.0.9 (X11/20061206) MIME-Version: 1.0 To: skaller Cc: Vincent Hanquez , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocaml compiler features References: <45A87011.8080203@gmail.com> <200701141823.32855.jon@ffconsultancy.com> <20070114184148.GA26213@snarc.org> <200701142049.57959.jon@ffconsultancy.com> <20070115000544.GA28731@snarc.org> <20070115221717.GA9982@snarc.org> <1168910291.9207.62.camel@rosella.wigram> <20070116090002.GA14494@snarc.org> <1168956872.5332.28.camel@rosella.wigram> <20070116150027.GA17519@snarc.org> <1168969667.5178.18.camel@rosella.wigram> In-Reply-To: <1168969667.5178.18.camel@rosella.wigram> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-j-chkmail-Score: MSGID : 45AD2676.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45AD2676.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 ocaml:01 variants:01 variants:01 edgar:98 wrote:01 caml-list:01 functions:01 exceptions:01 exceptions:01 binding:02 seems:03 generally:03 finalizing:03 skaller wrote: > What about it? C manages to handle all that .. and has no exceptions. > I think the point here is that because OCaml has exceptions (that other people use, maybe not you), it should also have finally blocks to allow them to easily do what you do without exceptions. > But adding 'finally' may not be the best solution, > the try/let construction looks better to me. > I can't find an example of this. Something about doing variable binding as part of the try statement, and then finalizing how? > But typically I do that kind of > thing the C way, which is generally the Ocaml way too: > you propagate return codes from functions using variants > up call chains. > The OCaml standard library seems to be programmed using exceptions over variants. I'll have to say I don't like or use exceptions much, but I'm forced to by the standard libraries. E.