From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA10566 for caml-redistribution@pauillac.inria.fr; Fri, 12 Nov 1999 10:00:46 +0100 (MET) Resent-Message-Id: <199911120900.KAA10566@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA04546 for ; Wed, 10 Nov 1999 14:22:04 +0100 (MET) Received: from beach.frankfurt.netsurf.de ([194.64.181.2]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id OAA04878 for ; Wed, 10 Nov 1999 14:21:58 +0100 (MET) Received: from ice.darmstadt.netsurf.de (board-18.darmstadt.netsurf.de [194.163.86.146]) by beach.frankfurt.netsurf.de (8.8.5/8.8.5) with ESMTP id OAA21073 for ; Wed, 10 Nov 1999 14:21:49 +0100 (MET) Received: from localhost (localhost [[UNIX: localhost]]) by ice.darmstadt.netsurf.de (8.9.3/8.9.3) id BAA26221 for caml-list@inria.fr; Wed, 10 Nov 1999 01:20:04 +0100 From: Gerd Stolpmann Reply-To: Gerd.Stolpmann@darmstadt.netsurf.de Organization: privat To: caml-list@inria.fr Subject: Exceptions inside assertions Date: Wed, 10 Nov 1999 01:06:57 +0100 X-Mailer: KMail [version 1.0.21] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <99111001200402.23873@ice> Content-Transfer-Encoding: 8bit Resent-From: weis@pauillac.inria.fr Resent-Date: Fri, 12 Nov 1999 10:00:46 +0100 Resent-To: caml-redistribution@pauillac.inria.fr Hi, I have a problem with exceptions which are raised within the expression of an assertion, e.g. assert (raise Not_found) The current behaviour is that the exception "falls through the assertion" which may not be appropriate for some cases. For example, consider assert (Queue.peek queue == current_element) >>From my point of view, the assertion expresses that "queue" has at least one element and that this element is identical to "current_element". But if the assertion is violated because the queue is empty, I only get a Queue.Empty exception, and I do not see the reason for it. Perhaps I even catch Queue.Empty, and the program continues, which is very hard to find out. I suggest to introduce a new Assert_failure_by_exception exception to better report this situation. Gerd -- ---------------------------------------------------------------------------- Gerd Stolpmann Telefon: +49 6151 997705 (privat) Viktoriastr. 100 64293 Darmstadt EMail: Gerd.Stolpmann@darmstadt.netsurf.de (privat) Germany ----------------------------------------------------------------------------