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=none 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 15DB7BC0A for ; Wed, 14 Feb 2007 22:11:15 +0100 (CET) Received: from coriana6.cis.mcmaster.ca (coriana6.CIS.McMaster.CA [130.113.128.17]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1ELBENL013235 for ; Wed, 14 Feb 2007 22:11:14 +0100 Received: from Dura7.UTS.McMaster.CA (dura7.UTS.mcmaster.ca [130.113.196.62]) by coriana6.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id l1ELB4rA014279; Wed, 14 Feb 2007 16:11:12 -0500 (EST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.mcmaster.ca [130.113.64.46]) by Dura7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id l1ELAZBI015163; Wed, 14 Feb 2007 16:10:35 -0500 Received: from [74.109.166.109] (account carette@univmail.cis.mcmaster.ca HELO [192.168.1.101]) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 162248299; Wed, 14 Feb 2007 16:10:35 -0500 Message-ID: <45D37AD0.3090002@mcmaster.ca> Date: Wed, 14 Feb 2007 16:10:40 -0500 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Nathaniel Gray Cc: OCaml Subject: Re: [Caml-list] Patterns that evaluate References: <45D23608.4030104@mcmaster.ca> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 4.7.1.128075, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2007.2.14.124934 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-Miltered: at discorde with ID 45D37AF2.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 syntax:01 mismatch:01 ocaml:01 haskell:01 wrote:01 wrote:01 imho:01 caml-list:01 argument:02 match:02 mcmaster:02 mcmaster:02 philosophy:02 languages:03 Nathaniel Gray wrote: > On 2/13/07, Jacques Carette wrote: >> So I wrote (in part): >> >> let buildsimp cast e f1 f2 = fun e1 -> fun e2 -> match (e1,e2) with >> | ({st = Some e}, _) >> -> e2 >> >> and I expected it to work. Only a code review by a colleague 'found' >> this bug in my code. > > I guess I'm not seeing it. How did you expect it to work? Is this > what you mean: > > ... | ({st = Some v}, _) when v = e -> e2 Yes. that is what I meant. > Is there some functionality that you're looking for that when clauses > don't provide? No, there is not. I was just (mistakenly) assuming that the "more pleasant" syntax for this ``worked''. Explanation: when I was a language designer, I learned a lot from user 'mistakes' like this. Such mistakes told me of the mismatch between user expectations and current reality. So I try to take the time to document my own 'mistakes'. Philosophy: if I don't take the time to give feedback, why should I expect users of my own work to be any different? Jacques PS: there is no real functionality that I am looking for that Turing Machines don't provide (or C or Java or ...). And yet I prefer languages like (Meta)OCaml and Haskell. The "raw functionality" argument does not seem to be the optimal way to look at these issues, IMHO.