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 MAA14931; Wed, 30 Jul 2003 12:22:20 +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 MAA19150 for ; Wed, 30 Jul 2003 12:22:18 +0200 (MET DST) Received: from mclean.mail.mindspring.net (mclean.mail.mindspring.net [207.69.200.57]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6UAMHf01733 for ; Wed, 30 Jul 2003 12:22:17 +0200 (MET DST) Received: from user-0ccekej.cable.mindspring.com ([24.199.81.211] helo=[192.168.0.3]) by mclean.mail.mindspring.net with esmtp (Exim 3.33 #1) id 19ho65-0004Po-00 for caml-list@inria.fr; Wed, 30 Jul 2003 06:22:17 -0400 Subject: Re: [Caml-list] assert caught by try with _ From: "Yaron M. Minsky" To: Caml List In-Reply-To: <4.3.2.7.2.20030729113455.02401e98@localhost> References: <4.3.2.7.2.20030728192639.025496d8@localhost> <4.3.2.7.2.20030728112622.02f3fef8@localhost> <00d301c3553b$9c01f030$ca00a8c0@warp> <4.3.2.7.2.20030728192639.025496d8@localhost> <4.3.2.7.2.20030729113455.02401e98@localhost> Content-Type: text/plain Organization: Cornell University Message-Id: <1059560536.25904.1451.camel@dragonfly.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 30 Jul 2003 06:22:16 -0400 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 cornell:01 caml-list:01 hecker:01 debugging:01 debugger:01 popping:01 bug:01 hard-coded:01 camlp:01 escapes:01 asserts:01 keyid:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 2003-07-29 at 17:01, Chris Hecker wrote: > >But you might really want to catch assert failures! > >For instance if you're building a debugging tool. > > Okay, but it seems like a compile time switch would serve both > interests. Plus, it seems like the "assert should blow up" usage would be > far more common, since the number of people writing non-debugging-tool code > is far larger than the number writing debugging tool code. > > 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. I could > use a different function than assert, but then it won't compile out, > etc. I could use camlp4 to make my own assert, but then I take a > compilation speed hit on all my files, etc. > > Anyway, it sounds like this behavior isn't surprising to anybody else, so > I'll add it to the list of things that only I think are broken about ocaml. :) Not so fast. I have hit the same issue and entirely agree. In general, the issue of making sure that an exception escapes when you want it to is a bit of a problem, and it would be nice to have some way of dealing with this, and not just with asserts. But certainly asserts should have the option for the kind of always-die behavior you're talking about. y -- |--------/ Yaron M. Minsky \--------| |--------\ http://www.cs.cornell.edu/home/yminsky/ /--------| Open PGP --- KeyID B1FFD916 (new key as of Dec 4th) Fingerprint: 5BF6 83E1 0CE3 1043 95D8 F8D5 9F12 B3A9 B1FF D916 ------------------- 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