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 PAA05558; Wed, 3 Dec 2003 15:01:41 +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 PAA05084 for ; Wed, 3 Dec 2003 15:01:40 +0100 (MET) Received: from inria.fr (macaque.inria.fr [128.93.8.158]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hB3E1er09114 for ; Wed, 3 Dec 2003 15:01:40 +0100 (MET) Date: Wed, 3 Dec 2003 15:02:02 +0100 Subject: Re: [Caml-list] Question Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v553) From: Damien Doligez To: OCaml Mailing list Content-Transfer-Encoding: 7bit In-Reply-To: <3FCB610E.932B363B@tni.fr> Message-Id: <44F3B4CD-2599-11D8-A285-00039310CAE8@inria.fr> X-Mailer: Apple Mail (2.553) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 damien:01 damien:01 furic:01 toto:01 toto:01 o'caml's:01 doligez:01 doligez:01 match:02 match:02 titi:02 titi:02 wrote:03 sebastien:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Monday, December 1, 2003, at 04:41 PM, sebastien FURIC wrote: > # let test t t' = match t, t' with > | ((Toto _ | Titi _), Toto x | Toto x, (Toto _ | Titi _)) when x = 0 > -> "OK" > | _ -> "KO";; > Characters 73-79: > Warning: this pattern is unused. > | ((Toto _ | Titi _), Toto x | Toto x, (Toto _ | Titi _)) when x = 0 > -> "OK" > ^^^^^^ [...] > I was expecting "when" to be right distributive over "|". That notion doesn't make sense because "when" is not a pattern operator. If you "distribute" when over |, you get this: # let test t t' = match t, t' with | ((Toto _ | Titi _), Toto x when x = 0 | Toto x, (Toto _ | Titi _) when x = 0) -> "OK" | _ -> "KO";; which is nonsense, from O'Caml's point of view. -- Damien ------------------- 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