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: William Lovas <wlovas@s...>
Subject: Re: [Caml-list] assert caught by try with _
On Wed, Aug 06, 2003 at 02:19:41PM +0200, Michal Moskal wrote:
> On Tue, Jul 29, 2003 at 02:01:07PM -0700, Chris Hecker wrote:
> > Another way of thinking about this is that almost everybody re-#defines 
> > assert in production C/C++ programs to do their own assert handling during 
> > development (whether it's printing out additional information, allowing you 
> > to drop into the debugger, popping up a message box, sending bug email, 
> > whatever).  With assert hard-coded into ocaml, you can't do this.  
> 
> try
>   main ()
> with Assert_failure (line, col, file) -> (* or whatever it is *)
>   prerr_endline "Panic! Contact support"

This won't trigger, though, if the exception has already been caught
upstream.

William

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