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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 454A4BC6C for ; Fri, 8 Feb 2008 16:39:50 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJ4GrEfAXQInh2dsb2JhbACQNQEBAQgKKZs3 X-IronPort-AV: E=Sophos;i="4.25,322,1199660400"; d="scan'208";a="8965738" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Feb 2008 16:39:49 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m18FdnnY000406 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 8 Feb 2008 16:39:49 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJ4GrEfBMVMPn2dsb2JhbACQNQEBAQEBBgQGCQgYmzc X-IronPort-AV: E=Sophos;i="4.25,322,1199660400"; d="scan'208";a="8965737" Received: from kabis.univ-orleans.fr (HELO ka.univ-orleans.fr) ([193.49.83.15]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Feb 2008 16:39:48 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id 74C8912AF84; Fri, 8 Feb 2008 16:39:48 +0100 (CET) Received: from [192.168.0.1] (lau18-1-82-246-197-195.fbx.proxad.net [82.246.197.195]) by smtps.univ-orleans.fr (Postfix) with ESMTP id 9B30E36E5B; Fri, 8 Feb 2008 16:39:50 +0100 (CET) Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2 From: David Teller To: =?ISO-8859-1?Q?B=FCnzli?= Daniel Cc: caml-list List In-Reply-To: References: <1202396482.6084.5.camel@Blefuscu> <20080208.001729.233402575.garrigue@math.nagoya-u.ac.jp> <20080208095333.GA582@snarc.org> <1202467938.47ac3462d077a@imp.free.fr> <20080208115635.GA2885@snarc.org> Content-Type: text/plain; charset=utf-8 Date: Fri, 08 Feb 2008 16:39:45 +0100 Message-Id: <1202485185.7079.18.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 47AC77C5.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; univ-orleans:01 0100,:01 compiler:01 variants:01 variants:01 cheers:01 univ-orleans:01 lifo:01 degenerate:98 liquidations:98 polymorphic:01 polymorphic:01 wrote:01 caml-list:01 surprising:01 On Fri, 2008-02-08 at 13:40 +0100, Bünzli Daniel wrote: > Le 8 févr. 08 à 12:56, Vincent Hanquez a écrit : > > If I use normal variant, the compiler will prevent me using the same > > code to match a X.Error and a Y.Error. > > Note that with this take 2 proposal -- that I personnaly find too > invasive and heavy weight -- you won't get that, you will have to > match on Error.Error (!) instead of `Error (take 1). > > Daniel Well, I do expect people to do a "open Error" at some point in their code. You are correct that `Error is shorter than Error.Error. On the other hand, if you intend to use `Error and `Success as a standard for exceptionless error management, you will need to standardise the use of these specific polymorphic variants for this specific meaning and to either teach people how to write closed polymorphic variants or expect them to miss errors every so often. All this in a context where one of the main objectives is to make error-management easier and safer. Both systems have drawbacks -- not quite surprising. I believe that writing "open Error" if there's no ambiguity and "Error.Error" if there is any is a small price to pay. So for the moment, I stand behind take 2. Cheers, David P.S.: Everyone, please don't let this thread degenerate into a slugfest "polymorphic variants are way kool" vs. "polymorphic variants are obscene". -- 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.