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 FAA19702; Tue, 12 Aug 2003 05:24:49 +0200 (MET DST) 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 FAA26728 for ; Tue, 12 Aug 2003 05:24:48 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h7C3Okf29714 for ; Tue, 12 Aug 2003 05:24:46 +0200 (MET DST) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2/3.7W) with ESMTP id MAA19923; Tue, 12 Aug 2003 12:24:38 +0900 (JST) To: skaller@ozemail.com.au Cc: caml-list@inria.fr Subject: Re: [Caml-list] tpyping question In-Reply-To: <20030811114615Y.garrigue@kurims.kyoto-u.ac.jp> References: <1060564412.7474.11.camel@localhost.localdomain> <20030811114615Y.garrigue@kurims.kyoto-u.ac.jp> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030812122438E.garrigue@kurims.kyoto-u.ac.jp> Date: Tue, 12 Aug 2003 12:24:38 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; jacques:01 caml-list:01 ozemail:01 compiles:01 bug:01 val:01 or-patterns:01 subsumed:01 superfluous:01 int:01 garrigue:01 match:02 float:02 let:04 meaningful:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > From: skaller > > > type x = [`A | `B of int | `V of float];; > > let g (a:x) = a;; > > let f a = match a with > > | `A -> g a > > (* | `B _ *) | _ -> g a;; > > > > Compiles fine, but gives an error if the comments are > > removed. > > Indeed, there seems to be a bug here, since the non-commented version > should be equivalent to > > # let f a = match a with > | `A -> g a > | `B _ -> g a > | _ -> g a;; > val f : x -> x = This is now fixed in CVS. Redundant cases of or-patterns (i.e. subsumed by another case) are now ignored in exhaustivity check. This confirms what I said before: this was only a problem with redundant patterns. These are completely superfluous now, as pattern matching does not respect the order of patterns in or-patterns, but this may indeed change in the future: let f = function | `A -> g `A | `B a | a -> g a could become meaningful. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners