From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id B8B4DBBC4 for ; Mon, 30 Jan 2006 15:32:02 +0100 (CET) Received: from mail.barettadeit.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0UEW2QX014373 for ; Mon, 30 Jan 2006 15:32:02 +0100 Received: from [10.0.0.10] (alex.barettalocal.com [10.0.0.10]) by mail.barettadeit.com (Postfix) with ESMTP id 8EBEB12565 for ; Mon, 30 Jan 2006 15:32:39 +0100 (CET) Message-ID: <43DE235C.5050404@barettadeit.com> Date: Mon, 30 Jan 2006 15:31:56 +0100 From: Alessandro Baretta User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: OCaml Subject: Private exceptions Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 43DE2362.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 baretta:01 barettadeit:01 bug:01 recursive:01 expr:01 exception:01 exception:01 defining:01 matched:01 matched:01 explicitly:01 exceptions:01 exceptions:01 algorithm:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 I have a come across the following situation: I have a relatively complex algorithm where exception management SHOULD occur only at the outermost function call. I have managed to create a rather nasty bug by inadvertently recursing through a function which captures exceptions coming from the inner recursive and does not propagate them upwards. In this situation, I'd like to be able to declare an exception "private" to a module, such that that exception can only be matched within the scope of the exception declaration. I am currently sidestepping the problem by using an exception which is not exported by the defining module, and consequently cannot be matched explicitly, but it can be matched by a try with _ -> . Am I the only one with this kind of need? Alex