Version française
Home     About     Download     Resources     Contact us    
Browse thread
partial application warning unreliable?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: partial application warning unreliable?
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