From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id D9D7EBC6C for ; Thu, 7 Feb 2008 17:25:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADHAqkfBMVMPn2dsb2JhbACQMQEBAQEBBgQGCQgYm3I X-IronPort-AV: E=Sophos;i="4.25,316,1199660400"; d="scan'208";a="7063384" Received: from kabis.univ-orleans.fr (HELO ka.univ-orleans.fr) ([193.49.83.15]) by mail2-smtp-roc.national.inria.fr with ESMTP; 07 Feb 2008 17:25:28 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id 3B90912ADB4; Thu, 7 Feb 2008 17:25:28 +0100 (CET) Received: from [172.23.197.254] (unknown [195.221.38.254]) by smtps.univ-orleans.fr (Postfix) with ESMTP id E11BA36E5B; Thu, 7 Feb 2008 17:25:30 +0100 (CET) Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2 From: David Teller To: Jon Harrop Cc: caml-list@yquem.inria.fr In-Reply-To: <200802071533.35279.jon@ffconsultancy.com> References: <1202396482.6084.5.camel@Blefuscu> <200802071533.35279.jon@ffconsultancy.com> Content-Type: text/plain Date: Thu, 07 Feb 2008 17:25:28 +0100 Message-Id: <1202401528.6084.51.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; univ-orleans:01 subtyping:01 cheers:01 ocaml's:01 inherently:01 univ-orleans:01 lifo:01 circumstance:98 merit:98 teeth:98 toilet:98 liquidations:98 wrote:01 exception:01 exception:01 That's an interesting question. I believe we all agree, starting with Xavier Leroy, that 'Failure of string' was a quick-and-dirty solution with which we're stuck but should be brushed under the carpet as soon as possible. In fact, that's one of the problems this recommendation should help resolve. Now, concerning hierarchies. My personal experience with Java's exception hierarchies (which I assume are similar to .Net's) is that the only circumstance in which I've taken advantage of subtyping was to relate every exception to the mother-class Exception: try ... catch(Exception e) //Deal with all exceptions at once, for instance //by turning them into instances of RuntimeError ... Does anyone have a different experience on the subject ? Cheers, David On Thu, 2008-02-07 at 15:33 +0000, Jon Harrop wrote: > There is also some merit in the hierarchical classification of exceptions, > e.g. as .NET provides (class hierarchies). For example, you might make > Invalid_argument a base exception with derived exceptions for each of the > different functions that raise this exception, in order to carry more precise > information about what exactly went wrong. OCaml's current approach of > conveying a string argument is not in the API and feels unhygienic as a > consequence. Like brushing your teeth whilst on the toilet. We all do it, but > only because we're in a hurry and not because it is an inherently good idea. -- David Teller Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller Angry researcher: French Universities need reforms, but the LRU act brings liquidations.