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: Ville-Pertti Keinonen <will@e...>
Subject: Re: [Caml-list] Polymorphism and the "for" loop
Jon Harrop wrote:

>I see. Does this stem from historical reasons or is there a logical reason why 
>this should be a warning rather than an error?
>  
>
Good question.  Personally, I probably would've made it an error.

>Yes, whereas the current approach can "fail" silently:
>
># f (fun () -> 1);;
>- : unit = ()
>  
>
That's not a failure, just a lack of a warning, since the type system 
lacks the ability to propagate the "<warning-if-not-unit>" property that 
I suggested.

Compared to compilers for other languages, OCaml seems to me fairly easy 
to understand in its warnings/lack-thereof.  I've run into quite a bit 
of C++ code, compiled using GCC, that generates (unjustified) warnings 
about potentially uninitialized variables on some architectures 
(PA-RISC/HP-UX) but not others...

-------------------
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