From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 231ADBC6B for ; Fri, 29 Jun 2007 21:31:22 +0200 (CEST) Received: from smtp.janestcapital.com (www.janestcapital.com [66.155.124.107]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5TJVKRD021026 for ; Fri, 29 Jun 2007 21:31:21 +0200 Received: from [172.25.129.161] [38.96.172.125] by janestcapital.com with ESMTP (SMTPD-9.10) id AE190194; Fri, 29 Jun 2007 15:31:37 -0400 Message-ID: <46855E07.5030701@janestcapital.com> Date: Fri, 29 Jun 2007 15:31:19 -0400 From: Brian Hurt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeremy Yallop Cc: Caml List Subject: Re: [Caml-list] ANN: pattern guards References: <1183141562.5305.19.camel@rosella.wigram> <468555F9.7090005@ed.ac.uk> In-Reply-To: <468555F9.7090005@ed.ac.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 46855E08.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; foo:01 wrote:01 caml-list:01 match:02 match:02 pattern:04 brian:05 brian:05 mistaken:08 i'm:09 case:13 some:14 often:15 code:17 write:17 Jeremy Yallop wrote: > > Unless I'm mistaken you can write this as > > match x with > | Y (y as z) > | X (y,z) -> f y z > > Is there some more general case for which this won't work out? > I often times want to be able to write code like: match foo with | Y (y) with x = 3 | X(x, y) -> f x y Brian