From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by pauillac.inria.fr; Fri, 27 May 94 18:47:14 +0200 Received: from margaux.inria.fr by pauillac.inria.fr; Thu, 26 May 94 15:03:45 +0200 Received: from concorde.inria.fr by margaux.inria.fr, Thu, 26 May 1994 15:03:43 +0200 Received: from cri.ens-lyon.fr (cri.ens-lyon.fr [140.77.1.32]) by concorde.inria.fr (8.6.9/8.6.9) with SMTP id PAA26830 for ; Thu, 26 May 1994 15:03:44 +0200 Received: from lip.ens-lyon.fr (lip-gw) by cri.ens-lyon.fr (5.0/SMI-SVR4) id AA12757; Thu, 26 May 1994 15:03:32 --100 Received: from champagne.ens-lyon.fr by lip.ens-lyon.fr (4.1/SMI-4.1) id AA13138; Thu, 26 May 94 15:03:32 +0200 Date: Thu, 26 May 94 15:03:32 +0200 From: Judicael.Courant@lip.ens-lyon.fr (Judicael Courant) Message-Id: <9405261303.AA13138@lip.ens-lyon.fr> To: caml-list@margaux.inria.fr Subject: Irrelevant variables in patterns Sender: weis@pauillac.inria.fr Bonjour, j'ai perdu un (gros) bout de temps sur le (stupide) bug suivant : j'avais ecrit : try (f x) with NotFound -> raise toto au lieu de : try (f x) with Not_found -> raise toto Resultat : lorsqu'une exception etait levee dans l'evaluation de (f x), elle etait toujours rattrappee. Pourtant, si j'avais voulu rattrapper toutes les exceptions, il aurait ete beaucoup plus naturel d'ecrire : try (f x) with _ -> raise toto De maniere generale, le compilateur ne pourrait-il pas fournir un "Warning : irrelevant variable xxx in pattern yyy" lorsque qu'une variable liee dans un motif n'est pas utilisee ? Judicael Courant.