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 PAA13037; Wed, 14 Nov 2001 15:18:44 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA12814 for ; Wed, 14 Nov 2001 15:18:43 +0100 (MET) Received: from transmail12.infosources.fr (transmail12.infosources.fr [212.232.33.78]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id fAEEIgT19232 for ; Wed, 14 Nov 2001 15:18:42 +0100 (MET) Received: from infonie.fr (mailbox.infonie.fr [195.242.64.77]) by transmail12.infosources.fr (8.11.6/8.11.6) with SMTP id fAEEHd123123; Wed, 14 Nov 2001 15:17:39 +0100 (MET) Received: from Utilisateur ( Unverified [212.232.43.7] ) by infonie.fr with SMTP id 27291.4743280.2136252; Wed, 14 Nov 2001 15:17:39 +0100 Message-ID: <002801c16d17$1be432e0$072be8d4@Utilisateur> From: "Diego Olivier Fernandez Pons" To: Cc: "Caml" References: <200111121029.LAA0000005433@beaune.inria.fr> <15344.54024.333924.7353@lachesis.inria.fr> <000501c16c9f$9bfe03c0$2d2ce8d4@Utilisateur> <01111411472206.27595@beige> Subject: [Caml-list] Warnings possibles Date: Wed, 14 Nov 2001 02:26:01 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk La question du filtrage semble tranchée. Essayons une proposition qui se veut constructive : - Est-il possible d'avoir un warning quand on masque une variable lors d'un filtrage ? - Est-il possible (je veux dire est-ce réalisable ? difficile ? utile ?...) de signaler que deux motifs ne sont pas exclusifs let f = function | (0,1) -> 1 | (x,1) -> x | (1,y) -> y | _ -> 1 # Attention les motifs (x,1) et (1,y) ne sont pas disjoints par exemple (1,1) Je suppose qu'il doit y avoir des problèmes liés au motif universel _ (que l'on pourrait peut-être ignorer) let f = function (x,y) -> match (x,y) with | (0,1) -> 1 | (_,1) -> x | (1,_) -> y | _ -> 1 ;; ok ! (la superposition de motifs est ignorée car on utilise _ qui est ignoré sauf pour le dernier qui assure que tous les cas sont traités) Peut-être un flag "pedantic" comme en C pour avoir ces avertissements là ? Diego Olivier ------------------- 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