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 76281BC2F for ; Mon, 29 Nov 2004 19:42:49 +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 iATIgnVJ005211 for ; Mon, 29 Nov 2004 19:42:49 +0100 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 TAA05886 for ; Mon, 29 Nov 2004 19:42:48 +0100 (MET) Received: from hugh.cs.washington.edu (hugh.cs.washington.edu [128.208.2.43]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iATIgkfD005203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 29 Nov 2004 19:42:48 +0100 Received: from [128.208.2.33] (gerald.cs.washington.edu [128.208.2.33]) by hugh.cs.washington.edu (8.13.1/8.13.1/1.5) with ESMTP id iATIgkRa024915; Mon, 29 Nov 2004 10:42:46 -0800 (envelope-from djg@cs.washington.edu) Message-ID: <41AB6DA1.6000204@cs.washington.edu> Date: Mon, 29 Nov 2004 10:42:41 -0800 From: Dan Grossman 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: Christophe Raffalli Cc: 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> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41AB6DA9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41AB6DA6.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 foo:01 christophe:01 raffalli:01 wrote:01 foo:01 usefull:01 assert:01 assert:01 partial:01 partial:01 constructor:01 data:02 match: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: let (x,y) = (match f(x) with [x1;y1] -> (x,y) | _ -> assert false) in foo Christophe Raffalli wrote: > > 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 > > 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) >