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 RAA21529; Thu, 8 Nov 2001 17:21:53 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA21231 for ; Thu, 8 Nov 2001 17:21:52 +0100 (MET) Received: from crozet.trusted-logic.fr (mailhost.trusted-logic.fr [194.250.150.5]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id fA8GLpX28127 for ; Thu, 8 Nov 2001 17:21:51 +0100 (MET) Received: from ouessant.trusted-logic.fr (ouessant.trusted-logic.fr [192.168.1.201]) by crozet.trusted-logic.fr (Postfix) with ESMTP id D406AF8152 for ; Thu, 8 Nov 2001 17:21:50 +0100 (CET) Received: from trusted-logic.fr (IDENT:coscoy@barbade.trusted-logic.fr [192.168.1.19]) by ouessant.trusted-logic.fr (8.9.3/8.9.3) with ESMTP id RAA16634 for ; Thu, 8 Nov 2001 17:21:50 +0100 Message-ID: <3BEAB10C.9000709@trusted-logic.fr> Date: Thu, 08 Nov 2001 17:21:32 +0100 From: Yann Coscoy Organization: Trusted Logic User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5) Gecko/20011012 X-Accept-Language: fr, es, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Warning: this match case is unused. References: <3BEAB901.19333.21ACF8D8@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Rolf Wester wrote: > Hi, > > this is probably a trivial question but can someone tell me why: > > let f l n0 = > let n = List.length l in > match n with > n0 -> 1; > | _ -> 0;; > > Results in: > Warning: this match case is unused. The second n0 in pattern « n0 -> 1 » is the introduction of a fresh variable. It is not binded to n0 previously introduced in « f l n0 = ». I guess the function you had in mind is: let f l n0 = let n = List.length l in match n with n1 when n1=n0 -> 1; | _ -> 0;; -- Yann Coscoy - Trusted Logic 5 rue du Bailliage 78000 Versailles +33 (0) 1 30 97 74 76 http://www.trusted-logic.fr ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr