caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Private exceptions
@ 2006-01-30 14:31 Alessandro Baretta
  2006-02-01 16:36 ` [Caml-list] " Eric Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Alessandro Baretta @ 2006-01-30 14:31 UTC (permalink / raw)
  To: OCaml

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-01 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-30 14:31 Private exceptions Alessandro Baretta
2006-02-01 16:36 ` [Caml-list] " Eric Cooper
2006-02-01 17:21   ` Alessandro Baretta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).