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: Michal Moskal <malekith@p...>
Subject: Re: [Caml-list] assert caught by try with _
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"

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: When in doubt, use brute force. -- Ken Thompson : {E-,w}-- {b++,e}>+++ h

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