caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] assert caught by try with _
@ 2003-07-28 18:34 Chris Hecker
  2003-07-28 19:08 ` Nicolas Cannasse
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Chris Hecker @ 2003-07-28 18:34 UTC (permalink / raw)
  To: caml-list


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.

I just got bitten by this and spent a couple hours trying to figure out why 
my program silently stopped working.

Thanks,
Chris

# let _ = try assert false with _ -> ();;
- : unit = ()

-------------------
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


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

end of thread, other threads:[~2003-08-06 17:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-28 18:34 [Caml-list] assert caught by try with _ Chris Hecker
2003-07-28 19:08 ` Nicolas Cannasse
2003-07-29  2:37   ` Chris Hecker
2003-07-29  3:17     ` Jacques Garrigue
2003-07-29 21:01       ` Chris Hecker
2003-07-30 10:22         ` Yaron M. Minsky
2003-07-30 15:47           ` james woodyatt
2003-08-06 12:19         ` Michal Moskal
2003-08-06 14:50           ` William Lovas
2003-08-06 17:44             ` Michal Moskal
2003-07-30  5:44 ` Jason Hickey
2003-07-30  5:44 ` [Caml-list] unwind-protect Jason Hickey
2003-07-30 10:30   ` Yaron M. Minsky
2003-07-30 17:29     ` Didier Remy
2003-07-31  0:47       ` Jacques Garrigue
2003-07-30 14:44   ` William Lovas

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).