From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A445DBC92 for ; Mon, 29 Nov 2004 23:30:09 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iATMU9IF001167 for ; Mon, 29 Nov 2004 23:30:09 +0100 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 XAA13577 for ; Mon, 29 Nov 2004 23:30:09 +0100 (MET) Received: from mailout08.sul.t-online.com (mailout08.sul.t-online.com [194.25.134.20]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iATMU83S029128 for ; Mon, 29 Nov 2004 23:30:08 +0100 Received: from fwd03.aul.t-online.de by mailout08.sul.t-online.com with smtp id 1CYqnL-0005IE-02; Mon, 29 Nov 2004 20:02:43 +0100 Received: from serialm.homelinux.org (ZG7ppcZ1geYdAy8O1jUVQV-r94q3yfPtmrNlEVJC+VMzoFhy-Y3EsX@[217.229.145.246]) by fmrl03.sul.t-online.com with esmtp id 1CYqnE-05wTXE0; Mon, 29 Nov 2004 20:02:36 +0100 Received: from [192.168.0.4] (waltraud-wagner.manson.mm [192.168.0.4]) by serialm.homelinux.org (8.12.11/8.12.11) with ESMTP id iATJ2Umx020934 for ; Mon, 29 Nov 2004 20:02:31 +0100 (CET) Message-ID: <41AB7246.5060908@yahoo.de> Date: Mon, 29 Nov 2004 20:02:30 +0100 From: "Robert W." User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.3) Gecko/20040918 X-Accept-Language: de, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] partial match in let References: <41AB5819.2020206@univ-savoie.fr> In-Reply-To: <41AB5819.2020206@univ-savoie.fr> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-ID: ZG7ppcZ1geYdAy8O1jUVQV-r94q3yfPtmrNlEVJC+VMzoFhy-Y3EsX@t-dialin.net X-TOI-MSGID: c419c750-fdd6-4d23-aa2e-ba6ff991eb36 X-Miltered: at concorde with ID 41ABA2F1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41ABA2F0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 christophe:01 raffalli:01 foo:01 foo:01 semantically:01 usefull:01 ...:98 assert:01 partial:01 partial:01 constructor:01 explicitly:01 data:02 match:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Christophe Raffalli schrieb: > > Wish: I had like a way to avoid the partial match warning in code like > > let [x;y] = f (x) in foo > > Because if foo is long writing > > match f(x) with [x;y] -> foo | _ -> assert false > Wouldn't this be semantically equivalent to the constant function returning foo? What I mean, instead of explicitly adding the wild card pattern, you can can substitute another one without. This would lead to an exhaustive pattern matching as well. > is really ennoying, especially if you have a long sequence of let. > > I find usefull the partial match warning for match and function but > not for let (if you write a let, I think you are aware that your > matching will be partial for any data type with more than one > constructor, you do not need a warning) > I'm sure, there are formal problems with partial matching leading to serious serious headaches, but I'll need some time to think about. -- Robert...