Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] queasiness about Exit
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Pottier <francois.pottier@i...>
Subject: Re: [Caml-list] queasiness about Exit


> But I'm having trouble convincing myself that this won't get me into
> trouble with obscure bugs later as things get complicated and
> "predicate" or "map_for_effect_on_complex_data_structure" might themselves
> be implemented in terms of "try .. raise Exit .. with Exit -> .."
> constructs.

Indeed, if you use the same exception `Exit' throughout all of your code,
then you might get into this kind of trouble.

I'd suggest using a different exception every time you need one, to avoid the
risk of accidental capture. A module can declare an arbitrary number of
exceptions for internal use; you can even generate new exceptions dynamically
(using local modules, introduced by `let module') if needed (although that's
pretty rare).

François Pottier
Bug reports:  FAQ:
To unsubscribe, mail  Archives: