Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: Warnings in ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: akay@s...
Subject: Re: Warnings in ocaml

> eg      let _ = List.map f
>         in print_endline "done map..."
>  
> Are there any plans to provide a warning for this in ocaml?  
 
To save anyone else the bother, I'll point out the error of
my ways myself.  

I think SML has (had?) a check which stopped you accidentally
ignoring a function value before a semi-colon.  However, since
functions are first class citizens, why shouldn't you want to ignore
them just as you might ignore a list or integer value?

So instead, I propose you write an explicit ignore function for each
type you want to ignore:

val ignore_int : int -> unit
val ignore_fred : fred -> unit
...

Andrew Kay
Sharp Labs Europe Ltd, Oxford Science Park, Oxford, UK, OX4 4GA
Andrew.Kay@sharp.co.uk  Tel:+44 1865 747711 FAX:+44 1865 747717