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 EAA09582; Tue, 29 Jul 2003 04:37:13 +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 EAA07855 for ; Tue, 29 Jul 2003 04:37:12 +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 h6T2bAf28706 for ; Tue, 29 Jul 2003 04:37:10 +0200 (MET DST) Received: (qmail 12353 invoked from network); 29 Jul 2003 02:37:07 -0000 Received: from arda.pair.com (HELO checkerdell.d6.com) (209.68.1.133) by relay.pair.com with SMTP; 29 Jul 2003 02:37:07 -0000 X-pair-Authenticated: 209.68.1.133 Message-Id: <4.3.2.7.2.20030728192639.025496d8@localhost> X-Sender: checker@localhost X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Mon, 28 Jul 2003 19:37:08 -0700 To: "Nicolas Cannasse" , From: Chris Hecker Subject: Re: [Caml-list] assert caught by try with _ In-Reply-To: <00d301c3553b$9c01f030$ca00a8c0@warp> References: <4.3.2.7.2.20030728112622.02f3fef8@localhost> 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 caml-list:01 ignoring:01 runtime:01 specifics:01 debugging:01 chris:01 ocaml:01 assertions:01 assert:02 overflow:02 catching:02 exception:02 stack:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >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. I totally disagree about assert being the same as a stack overflow in nature, but more importantly, you're ignoring the lessons learned from C++ and Java on the exception specification front. You just don't know what exceptions code you call in a real program will throw in general. There are plenty of times when you want to try something at runtime and just bail if it doesn't work, and you don't care about the specifics of why it didn't work. A single "with _" will mask any assertions living below it, which seems to me to be a bad thing since by definition an assert is a development debugging tool. Assert should just blow up, like in C (at least as an option). You shouldn't have to remember to put a "with" clause in for it. Chris ------------------- 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