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 CAA21006; Fri, 19 Jul 2002 02:09:04 +0200 (MET DST) 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 CAA21002 for ; Fri, 19 Jul 2002 02:09:03 +0200 (MET DST) Received: from nexus.stwing.upenn.edu (NEXUS.STWING.UPENN.EDU [165.123.132.61]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g6J092H12744 for ; Fri, 19 Jul 2002 02:09:02 +0200 (MET DST) Received: from force.stwing.upenn.edu (daemon@force.stwing.upenn.edu [165.123.132.65]) by nexus.stwing.upenn.edu (8.11.6/8.11.6) with ESMTP id g6J090T15473 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified NO) for ; Thu, 18 Jul 2002 20:09:01 -0400 (EDT) Received: (from wlovas@localhost) by force.stwing.upenn.edu (8.11.6/8.11.6) id g6J090P22878 for caml-list@inria.fr; Thu, 18 Jul 2002 20:09:00 -0400 (EDT) Date: Thu, 18 Jul 2002 20:08:59 -0400 From: William Lovas To: Ocaml Subject: Re: [Caml-list] Pattern matching missing (or brain damage?) Message-ID: <20020719000859.GB22176@force.stwing.upenn.edu> Mail-Followup-To: Ocaml References: <3D373FB4.20509@baretta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D373FB4.20509@baretta.com> User-Agent: Mutt/1.3.25i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Jul 19, 2002 at 12:22:44AM +0200, Alessandro Baretta wrote: > I believe I remember a pattern matching construct where an > expression could be associated with multiple patterns. > > match with > | A(_) | B(_) | C(_) -> foo > | C(_) | D(_) | E(_) -> bar > > Neither does the compiler accept such code, nor does the > manual mention such construct. Has it been removed from the > language or am I suffering severe brain damage from too much > O'Caml coding? This is legal. It's covered in the Chapter 6 of the manual, under Patterns, sub-heading ``Or'' patterns: http://caml.inria.fr/ocaml/htmlman/manual014.html You might be having trouble if your subpatterns don't bind exactly the same variables... William ------------------- 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