From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id A2078BBA7 for ; Thu, 8 Dec 2005 03:39:15 +0100 (CET) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jB82dDQk029235 for ; Thu, 8 Dec 2005 03:39:14 +0100 Received: from rosella (ppp33-4.lns1.syd6.internode.on.net [59.167.33.4]) by ash25e.internode.on.net (8.12.9/8.12.6) with ESMTP id jB82dB98065945 for ; Thu, 8 Dec 2005 13:09:12 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: partial application warning unreliable? From: skaller To: caml-list@yquem.inria.fr Content-Type: text/plain Date: Thu, 08 Dec 2005 13:39:11 +1100 Message-Id: <1134009551.10435.24.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 43979CD1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; val:01 srcref:01 token:01 srcref:01 bug:01 sourceforge:01 imho:01 partial:01 partial:01 flx:01 flx:01 int:01 ast:01 parse:02 string:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 I have this: # let f x y = x + y;; # let a = f 1; 1;; Warning F: this function application is partial, maybe some arguments are missing. val a : int = 1 This is good -- I rely on it! class cc = object (self) method f x y = x + y method g () = self#f 1; end;; Warning F: this function application is partial, maybe some arguments are missing. yea, good .. method add_nonterminal (s:string) (sr:range_srcref) (toks: Flx_parse.token list) (term:ast_term_t) = ... state#add_nonterminal tok (Flx_srcref.slift sr) t; Method has 4 arguments, but the call applies to only 3. Woops, no warning!! Bad! This error of mine caused a serious bug -- the method call didn't do anything! Really this just shouldn't be allowed at all! We have ignore() function, IMHO its use should be required (except at the top level interpreter where you want to see the type of a term). But the point is .. the warning is unreliable! Why? In my real code the only difference is that the method being called is not visible -- it is called via a class interface. -- John Skaller Felix, successor to C++: http://felix.sf.net