From: Alessandro Baretta <a.baretta@barettadeit.com>
To: OCaml <caml-list@yquem.inria.fr>
Subject: Private exceptions
Date: Mon, 30 Jan 2006 15:31:56 +0100 [thread overview]
Message-ID: <43DE235C.5050404@barettadeit.com> (raw)
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 <expr> with _ -> <whatever>.
Am I the only one with this kind of need?
Alex
next reply other threads:[~2006-01-30 14:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-30 14:31 Alessandro Baretta [this message]
2006-02-01 16:36 ` [Caml-list] " Eric Cooper
2006-02-01 17:21 ` Alessandro Baretta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43DE235C.5050404@barettadeit.com \
--to=a.baretta@barettadeit.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox