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 MAA32030; Sun, 28 Oct 2001 12:03:55 +0100 (MET) 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 MAA32081 for ; Sun, 28 Oct 2001 12:03:54 +0100 (MET) Received: from leia.mandrakesoft.com (office.mandrakesoft.com [195.68.114.34]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9SB3sv11405 for ; Sun, 28 Oct 2001 12:03:54 +0100 (MET) Received: by leia.mandrakesoft.com (Postfix, from userid 505) id BB8D25708; Sun, 28 Oct 2001 12:02:02 +0100 (CET) To: caml-list@pauillac.inria.fr Subject: [Caml-list] "Or" patterns when both matchings From: Pixel Date: 28 Oct 2001 12:02:02 +0100 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk from the documentation: The pattern pattern1 | pattern2 represents the logical ``or'' of the two patterns pattern1 and pattern2. [...] If both matchings succeed, it is undefined which set of bindings is selected. is there a reason for not using the classical pattern matching rule, to make the ordering matters? (i've been nastily beat by this :-/) eg: type foo = Bar | Foo of foo let f1 = function | Foo(a) | a -> a let f2 = function | Foo(a) -> a | a -> a let e1 = f1 (Foo Bar) (*=> Foo Bar *) let e2 = f2 (Foo Bar) (*=> Bar *) thanks -- Pixel ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr