Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Polymorphism and the "for" loop
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@j...>
Subject: Re: [Caml-list] Polymorphism and the "for" loop
On Thursday 21 October 2004 20:12, Ville-Pertti Keinonen wrote:
> Consider the fact that it's a warning as opposed to an error.

I see. Does this stem from historical reasons or is there a logical reason why 
this should be a warning rather than an error?

> ...
> If your second example produced a type of unit -> unit for g, I think 
> your first example should fail with an error (rather than be accepted 
> with a warning).

Yes, whereas the current approach can "fail" silently:

# f (fun () -> 1);;
- : unit = ()

Cheers,
Jon.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners