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 HAA31657; Wed, 30 Jul 2003 07:44:09 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 HAA03660 for ; Wed, 30 Jul 2003 07:44:08 +0200 (MET DST) Received: from yukon.yapper.org (adsl-67-120-175-89.dsl.lsan03.pacbell.net [67.120.175.89]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6U5i6T02154 for ; Wed, 30 Jul 2003 07:44:07 +0200 (MET DST) Received: from kenai.yapper.org (kenai.yapper.org [67.120.175.90]) by yukon.yapper.org (Postfix) with ESMTP id 00FE05CD; Tue, 29 Jul 2003 22:44:03 -0700 (PDT) Received: from cs.caltech.edu (localhost [127.0.0.1]) by kenai.yapper.org (Postfix) with ESMTP id 511978131A; Tue, 29 Jul 2003 22:44:03 -0700 (PDT) Message-ID: <3F275B23.6050100@cs.caltech.edu> Date: Tue, 29 Jul 2003 22:44:03 -0700 From: Jason Hickey Organization: Caltech User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030211 X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: caml-list@inria.fr Subject: Re: [Caml-list] assert caught by try with _ References: <4.3.2.7.2.20030728112622.02f3fef8@localhost> In-Reply-To: <4.3.2.7.2.20030728112622.02f3fef8@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; hickey:01 caml-list:01 hecker:01 statically:01 scalable:01 626:99 792:99 chris:01 handler:01 raises:01 caltech:01 syntax:02 assert:02 exception:02 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Chris Hecker wrote: > Is the the "right thing" for assert to be caught by a try ... with _ -> > ... block? I don't know. It seems reasonable to have exceptional conditions caught by the exception handler... However, it may be reasonable to ask for more than one exception type--it seems like poor software engineering to statically list *all* the possible reasonable exceptions in a try/with block, except for Assert_failure. This idea will fail as new exceptions are added. To help avoid this problem, in our work we generally declare a type of application errors (not the exact syntax but close enough): type application_error = NoClue | BadIdea of string | IWouldIfICouldButICantSoIWont | ... exception ApplicationError of application_error All raises are of the form (raise (ApplicationError ...)), and the "default" exception handler is (try ... with ApplicationError _ -> ...). This idea works ok, but is not scalable. Jason -- Jason Hickey http://www.cs.caltech.edu/~jyh Caltech Computer Science Tel: 626-395-6568 FAX: 626-792-4257 ------------------- 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