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 QAA18914; Sat, 20 Jul 2002 16:28:47 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA18908 for caml-list@pauillac.inria.fr; Sat, 20 Jul 2002 16:28:46 +0200 (MET DST) 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 AAA19957 for ; Fri, 19 Jul 2002 00:36:22 +0200 (MET DST) Received: from swordfish.cs.caltech.edu (swordfish.cs.caltech.edu [131.215.44.124]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g6IMaLH11838 for ; Fri, 19 Jul 2002 00:36:21 +0200 (MET DST) Received: from orchestra.cs.caltech.edu (orchestra.cs.caltech.edu [131.215.44.20]) by swordfish.cs.caltech.edu (Postfix) with ESMTP id 3DDD6DF25B; Thu, 18 Jul 2002 15:36:20 -0700 (PDT) Received: (from mvanier@localhost) by orchestra.cs.caltech.edu (8.11.6/8.9.3) id g6IMaJG11734; Thu, 18 Jul 2002 15:36:19 -0700 Date: Thu, 18 Jul 2002 15:36:19 -0700 Message-Id: <200207182236.g6IMaJG11734@orchestra.cs.caltech.edu> X-Authentication-Warning: orchestra.cs.caltech.edu: mvanier set sender to mvanier@cs.caltech.edu using -f From: Michael Vanier To: alex@baretta.com Cc: caml-list@inria.fr In-reply-to: <3D373FB4.20509@baretta.com> (message from Alessandro Baretta on Fri, 19 Jul 2002 00:22:44 +0200) Subject: Re: [Caml-list] Pattern matching missing (or brain damage?) References: <3D373FB4.20509@baretta.com> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk # type ex = A of int | B of int | C of int | D of int | E of int;; type ex = A of int | B of int | C of int | D of int | E of int # let a = A 1000;; val a : ex = A 1000 # match a with A(_) | B(_) | C(_) -> "foo" | C(_) | D(_) | E(_) -> "bar";; - : string = "foo" You put in an extra | before the A(_). Mike > Date: Fri, 19 Jul 2002 00:22:44 +0200 > From: Alessandro Baretta > > 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? > > Alex > > ------------------- > 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 > ------------------- 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