From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA31482; Mon, 28 Jul 2003 20:43:41 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA28900 for ; Mon, 28 Jul 2003 20:43:40 +0200 (MET DST) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id h6SIhcf10163 for ; Mon, 28 Jul 2003 20:43:39 +0200 (MET DST) Received: (qmail 66282 invoked from network); 28 Jul 2003 18:43:36 -0000 Received: from arda.pair.com (HELO checkerdell.d6.com) (209.68.1.133) by relay.pair.com with SMTP; 28 Jul 2003 18:43:36 -0000 X-pair-Authenticated: 209.68.1.133 Message-Id: <4.3.2.7.2.20030728112622.02f3fef8@localhost> X-Sender: checker@localhost X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Mon, 28 Jul 2003 11:34:58 -0700 To: caml-list@inria.fr From: Chris Hecker Subject: [Caml-list] assert caught by try with _ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Loop: caml-list@inria.fr X-Spam: no; 0.00; hecker:01 checker:01 asserts:01 silently:01 chris:01 workaround:01 handler:01 assert:02 exception:02 unit:03 let:04 somewhere:04 seems:05 maybe:06 prone:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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