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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 33CD3BC70 for ; Sat, 11 Aug 2007 20:18:03 +0200 (CEST) Received: from mta13.k8.com.br (mta13.k8.com.br [200.185.109.19]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7BIHxZW016761 for ; Sat, 11 Aug 2007 20:18:02 +0200 Received: from localhost (localhost [127.0.0.1]) by smtpa.k8.com.br (Postfix) with ESMTP id 53F857000C4D for ; Sat, 11 Aug 2007 15:17:56 -0300 (BRT) X-Virus-Scanned: amavisd-new at k8.com.br Received: from smtpa.k8.com.br ([127.0.0.1]) by localhost (mta13.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KAywjMyVcuQS for ; Sat, 11 Aug 2007 15:17:56 -0300 (BRT) Received: from [189.24.68.133] (unknown [189.24.68.133]) by smtpa.k8.com.br (Postfix) with ESMTP id 06AC970008AF for ; Sat, 11 Aug 2007 15:17:55 -0300 (BRT) Subject: Labeled arguments and polymorphic return types From: Andre Nathan To: caml-list@inria.fr Content-Type: text/plain Date: Sat, 11 Aug 2007 15:17:32 -0300 Message-Id: <1186856252.6007.11.camel@homesick> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46BDFD57.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; val:01 nathan:98 polymorphic:01 int:01 int:01 define:02 argument:02 argument:02 unit:03 let:03 raise:03 raise:03 exit:04 types:05 generated:05 Hello Consider the following definition: # let f ~a = print_int a; raise Exit;; val f : a:int -> 'a = If I call f without using the argument label, I get the following warning: # f 1;; Warning X: this argument will not be used by the function. - : a:int -> 'a = The call works if I use the label ("f ~a:1"), if I define f without a label for its argument, or if I remove the "raise" statement (causing the return value to be unit instead of 'a). Why is this warning generated? Thanks in advance, Andre