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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 9AC22BBCA for ; Wed, 27 Feb 2008 22:32:44 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGNlxUfAXQInh2dsb2JhbACQaAEBAQgKKZ0BgXo X-IronPort-AV: E=Sophos;i="4.25,415,1199660400"; d="scan'208";a="23129263" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 27 Feb 2008 22:32:44 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1RLWd5P029231 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 27 Feb 2008 22:32:44 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGNlxUfBMVMPkmdsb2JhbACQaAEBAQEHBAYHIp0BgXo X-IronPort-AV: E=Sophos;i="4.25,415,1199660400"; d="scan'208";a="23129262" Received: from kabis.univ-orleans.fr (HELO ka.univ-orleans.fr) ([193.49.83.15]) by mail4-smtp-sop.national.inria.fr with ESMTP; 27 Feb 2008 22:32:43 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id 5F02512ADFF for ; Wed, 27 Feb 2008 22:32:41 +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 4791E36E5B for ; Wed, 27 Feb 2008 22:32:45 +0100 (CET) Subject: "Warning U: this match case is unused." -- Yes, I know From: David Teller To: OCaml Content-Type: text/plain Date: Wed, 27 Feb 2008 22:32:38 +0100 Message-Id: <1204147958.7005.17.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 47C5D6F7.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; univ-orleans:01 camlp:01 bindings:01 catch-all:01 semantics:01 rewriting:01 compiler:01 univ-orleans:01 lifo:01 liquidations:98 match:02 match:02 ensuring:02 clause:03 clause:03 Dear list, I'm currently working on a little Camlp4 extension which has to often generate pattern-matching clauses depending on user code -- and deal with match failures accordingly. Now, I guess 1. I can wrap the user's pattern-matching inside a try...with, catch any Match_failure and deal with it. However, ensuring that the Match_failure is the right one and that I'm not catching some other error in the code, all this while performing bindings satisfactorily will require numerous contorsions. 2. I can add a catch-all clause " _ -> deal_with_error ". While the semantics of this rewriting are exactly what I need, the compiler tends to print "Warning U: this match case is unused" whenever the user has already taken care of all cases. I would need to find a way to deactivate the warning for this specific clause. As I haven't found any way of doing that directly, I've been thinking about adding a "when True" to the second-to-last clause if that clause doesn't already have a "when", but I'd be glad to hear about better solutions. Thanks in advance, 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.