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 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 7D215BC6B for ; Mon, 21 May 2007 09:49:10 +0200 (CEST) Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4L7n9vQ002352 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Mon, 21 May 2007 09:49:10 +0200 Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1Hq2de-0000Nr-CR; Mon, 21 May 2007 09:49:06 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.67) (envelope-from ) id 1Hq2dc-0001zb-82; Mon, 21 May 2007 09:49:04 +0200 From: Florian Weimer To: Alain Frisch Cc: Jon Harrop , caml-list@yquem.inria.fr Subject: Re: [Caml-list] try .. finally .. References: <200705201842.59978.jon@ffconsultancy.com> <4650A1EA.3050302@inria.fr> Date: Mon, 21 May 2007 09:49:04 +0200 In-Reply-To: <4650A1EA.3050302@inria.fr> (Alain Frisch's message of "Sun, 20 May 2007 21:30:50 +0200") Message-ID: <87wsz2aa6n.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at discorde with ID 46514EF5.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 exn:01 exn:01 caml-list:01 alain:01 match:02 florian:03 let:03 raise:03 returns:11 think:12 some:14 some:14 try:19 try:19 * Alain Frisch: > Why not: > > let unwind_protect f g = > match (try f (); None with exn -> Some exn) with > | None -> g () > | Some exn -> g (); raise exn > > ? unwind_protect traditionally returns the value of f (), not that of g (). I think it is fundamentally non-tail-call.