From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AEF32BB9C for ; Sat, 10 Dec 2005 02:40:32 +0100 (CET) Received: from comtv.ru (mail.comtv.ru [217.10.32.19]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jBA1eV44020310 for ; Sat, 10 Dec 2005 02:40:32 +0100 X-UCL: actv Received: from av1474.oops ([10.0.66.9] verified) by comtv.ru (CommuniGate Pro SMTP 4.1.8) with ESMTP id 110297490; Sat, 10 Dec 2005 04:40:31 +0300 Date: Sat, 10 Dec 2005 04:40:46 +0300 (MSK) From: malc X-X-Sender: malc@home.oyster.ru To: Jacques Garrigue Cc: caml-list@yquem.inria.fr, skaller@users.sourceforge.net Subject: Re: [Caml-list] partial application warning unreliable? In-Reply-To: <20051210.094908.32150993.garrigue@math.nagoya-u.ac.jp> Message-ID: References: <1134092611.8940.57.camel@rosella> <20051209.111523.100788477.garrigue@math.nagoya-u.ac.jp> <20051210.094908.32150993.garrigue@math.nagoya-u.ac.jp> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 439A320F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; malc:01 malc:01 pulsesoft:01 caml-list:01 pulsesoft:01 annotation:01 recursive:01 inference:01 wrote:01 polymorphic:01 partial:01 avoids:01 jacques:01 modules:01 defined:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Sat, 10 Dec 2005, Jacques Garrigue wrote: > From: malc > >> I gather all this means that the only "safe" way to call a unit method >> on an implictily typed object is via: >> >> let () = o#moo in ... > > Yes, but only if the type of o is unknown. > If o itself was defined by a let statement, or there was a type > annotation > let f (o : c) = ... > then the warnings will work properly (fortunately.) I haven't done that because in my particular case that would have required recursive modules (and not inside the same source unit). And having two set of class types that described type of o didn't really appeal to me all that much. > > Personally, I annotate almost all objects received as function > arguments. It may be seen as defeating the purpose of type inference, but > this produces better error messages, and avoids the above problem. > It is also necessary with polymorphic methods or optional arguments. -- mailto:malc@pulsesoft.com