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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A15AABBCA for ; Wed, 27 Feb 2008 23:21:39 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKJwxUfAXQInh2dsb2JhbACQaAEBAQgKKZ0r X-IronPort-AV: E=Sophos;i="4.25,415,1199660400"; d="scan'208";a="8684813" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 27 Feb 2008 23:21:39 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1RMLdop030894 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 27 Feb 2008 23:21:39 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKJwxUfBMVMQh2dsb2JhbACQaAEBAQgKKZ0r X-IronPort-AV: E=Sophos;i="4.25,415,1199660400"; d="scan'208";a="8684812" Received: from minbis.univ-orleans.fr (HELO min.univ-orleans.fr) ([193.49.83.16]) by mail1-smtp-roc.national.inria.fr with ESMTP; 27 Feb 2008 23:21:39 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by min.univ-orleans.fr (Postfix) with ESMTP id 9895C12B406; Wed, 27 Feb 2008 23:21:38 +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 C8E9C36E5B; Wed, 27 Feb 2008 23:21:42 +0100 (CET) Subject: Re: [Caml-list] "Warning U: this match case is unused." -- Yes, I know From: David Teller To: Edgar Friendly Cc: OCaml In-Reply-To: <47C5DF7C.4010107@gmail.com> References: <1204147958.7005.17.camel@Blefuscu> <47C5DF7C.4010107@gmail.com> Content-Type: text/plain Date: Wed, 27 Feb 2008 23:21:37 +0100 Message-Id: <1204150897.7005.44.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 47C5E273.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; univ-orleans:01 compiler:01 'when':01 rephrase:01 one-liner:01 foobar:01 cheers:01 univ-orleans:01 lifo:01 edgar:98 threat:98 liquidations:98 wrote:01 exception:01 exception:01 On Wed, 2008-02-27 at 16:09 -0600, Edgar Friendly wrote: > > 1. I can wrap the user's pattern-matching inside a try...with, catch any > > Match_failure and deal with it. > This seems hackish. Indeed. I'm not planning to carry on that threat :) > It may seem that you've taken care of all cases, but keep in mind that > the compiler looks at a match case containing a 'when' clause and > assumes that clause can cause the match to fail, independent of all > other terms. Let me rephrase. In my extension, the user can decide of *any* pattern. The main difference with usual OCaml-style pattern-matching is that the equivalent of Match_failure is not a fatal error. Think Erlang-style mailbox-checking or ML-style exception catching: if there's no interesting message waiting or if we're installing an exception handler for another exception than what has been raised, well, it's probably not an error. So I need to be able to specify what happens in case of match failure. Doing that is a one-liner, I can just add | _ -> foobar after my last match case. Now, I just want to get rid of Warning U. Cheers, David -- 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.