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 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D1455BC6B for ; Mon, 27 Aug 2007 15:09:01 +0200 (CEST) Received: from mail14.bluewin.ch (mail14.bluewin.ch [195.186.19.62]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7RD91xH001095 for ; Mon, 27 Aug 2007 15:09:01 +0200 Received: from [10.0.1.2] (85.2.101.8) by mail14.bluewin.ch (Bluewin 7.3.121) id 46C9BE0B00176BE4 for caml-list@yquem.inria.fr; Mon, 27 Aug 2007 13:09:01 +0000 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <200708271338.51566.jon@ffconsultancy.com> References: <9FA25C33-04DD-46BD-8959-873DDD2FFF82@epfl.ch> <1188214119.13927.16.camel@rosella.wigram> <07BE0325-B260-407C-A1BB-389D4C88311C@epfl.ch> <200708271338.51566.jon@ffconsultancy.com> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Subject: Re: [Caml-list] Has the thread cancellation problem evolved ? Date: Mon, 27 Aug 2007 15:09:03 +0200 To: caml-list@yquem.inria.fr X-Mailer: Apple Mail (2.752.2) X-Miltered: at concorde with ID 46D2CCED.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bunzli:01 buenzli:01 bunzli:01 exn:01 exn:01 toplevel:01 wrote:01 exception:01 exception:01 caml-list:01 reuse:01 epfl:02 cps:02 handler:03 let:03 Le 27 ao=FBt 07 =E0 14:38, Jon Harrop a =E9crit : > On Monday 27 August 2007 13:24:34 Daniel B=FCnzli wrote: >> And if you are really not a sloppy programmer you >> already have and use your own version of try/finally : >> >> let apply f x ~finally y =3D >> let res =3D try f x with exn -> finally y; raise exn in >> finally y; >> res > > Ironically, that's broken. :-) > > If your handler "finally" raises an exception then it would replace =20= > the Abort > exception. You should ignore any exception raised by "finally" if =20 > "f" raises > an exception. It depends on which exception you eventually want to get at the =20 toplevel, it is a choice. But I agree your choice makes more sense =20 than mine. > Then write in CPS and weave an abortable continuation between each =20 > step. Why not, but this a very low level solution and I cannot reuse =20 existing libraries that are not written in this style. I don't think =20 it is a reasonable answer. Daniel