Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] assert caught by try with _
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] assert caught by try with _
> Is the the "right thing" for assert to be caught by a try ... with _ ->
...
> block?  In other words, it seems like you want an assert to always blow up
> if asserts are turned on, not to fail silently when there's a try block
> somewhere higher up in the program.  Maybe it should be an option to have
> it fail immediately regardless of whether there's an exception handler
> around it?  The problem is that the workaround is to muck with every
"with"
> expression to ensure you don't accidentally catch an assert, which is a
> huge pain and error prone, so it seems easier to have an option to just
> blow up.  The rationale is that asserts are meta, not part of the main
> program's flow.

You could tell the same for stack overflow and some other kinds of
exceptions. OCaml uniformly treat failures as exceptions, and that's the
right thing to do. But catching exceptions with _ , without even printing
them, is not the "right thing" and is definitly huge pain and error prone.

Nicolas Cannasse

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners