caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* partial application warning unreliable?
@ 2005-12-08  2:39 skaller
  2005-12-08  3:10 ` [Caml-list] " Jacques Garrigue
  0 siblings, 1 reply; 15+ messages in thread
From: skaller @ 2005-12-08  2:39 UTC (permalink / raw)
  To: caml-list

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 <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2005-12-10  1:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-08  2:39 partial application warning unreliable? skaller
2005-12-08  3:10 ` [Caml-list] " Jacques Garrigue
2005-12-08  7:11   ` skaller
2005-12-08 14:41     ` Damien Doligez
2005-12-08 23:51   ` malc
2005-12-09  1:43     ` skaller
2005-12-09  2:15       ` Jacques Garrigue
2005-12-09  2:56         ` skaller
2005-12-09 15:26         ` malc
2005-12-10  0:49           ` Jacques Garrigue
2005-12-10  1:40             ` malc
2005-12-09 12:21       ` Andreas Rossberg
2005-12-09 17:17         ` skaller
2005-12-09 17:52           ` Andrej Bauer
2005-12-09 18:54           ` Andreas Rossberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).