Version française
Home     About     Download     Resources     Contact us    
Browse thread
Warning wished
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dmitri Boulytchev <db@t...>
Subject: Re: [Caml-list] Warning wished

> There's the question of what the compiler _does_, what the compiler 
> _could_ do and what the compiler _should_ do.
>
    The latter is mainly a matter of taste :) 

> I don't think "this 'a could be unit" is a good reason for skipping 
> the warning. On the contrary, "this 'a will probably sometimes be a 
> real value" seems a sufficient reason to add a warning. If needed, the 
> programmer can easily suppress the warning by adding "ignore" or 
> adding a ": unit" type constraint (whichever applies).
    I believe that compiler for statically-typed languages has to take 
all the responsibility on type information it delivers to user. So when 
it says "this
expression has type X, but here is used as type unit" it must not mean 
"well, sometimes it hasn't" :)
> (Remains to see whether adding the warning to OCaml is worth the 
> manwork.)
    IMHO it definitely doesn't deserve such a long discussion :))))

    BR,
    Dmitri.