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 GAA18693; Mon, 11 Aug 2003 06:30:01 +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 GAA28123 for ; Mon, 11 Aug 2003 06:30:00 +0200 (MET DST) Received: from mail3.tpgi.com.au (mail.tpgi.com.au [203.12.160.59]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h7B4Twf17312 for ; Mon, 11 Aug 2003 06:29:58 +0200 (MET DST) Received: from 203-213-83-171-syd-ts15-2600.tpgi.com.au (203-213-83-171-syd-ts15-2600.tpgi.com.au [203.213.83.171]) by mail3.tpgi.com.au (8.11.6/8.11.6) with ESMTP id h7B4Tqc12967; Mon, 11 Aug 2003 14:29:52 +1000 Subject: Re: [Caml-list] tpyping question From: skaller Reply-To: skaller@ozemail.com.au To: Jacques Garrigue Cc: caml-list@inria.fr In-Reply-To: <20030811114615Y.garrigue@kurims.kyoto-u.ac.jp> References: <1060564412.7474.11.camel@localhost.localdomain> <20030811114615Y.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain Message-Id: <1060576199.9476.19.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 11 Aug 2003 14:30:00 +1000 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ozemail:01 caml-list:01 jacques:01 compiles:01 or-patterns:01 bug:01 stub:01 int:01 garrigue:01 match:02 float:02 wrote:03 meaningless:03 let:04 pattern:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 2003-08-11 at 12:46, Jacques Garrigue wrote: > 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. > On the other hand, this code is meaningless, as _ is more general > than `B _, and the order of or-patterns is not significant. Yup. However, meaningless is not the same as wrong. The extra case arose because I had a bug and wanted to print a diagnostic. When I commented the print out, I got the error: I wanted to leave the pattern match there as a stub. I have had some other perplexing problems with multiple tags, perhaps if you fix the above problem they'll go a way .. sorry, I worked around them so don't have an example at the moment. ------------------- 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