Re: Warnings in ocaml

From: Andrew Kay (akay@sharp.co.uk)
Date: Mon Feb 22 1999 - 15:56:01 MET


Date: Mon, 22 Feb 1999 14:56:01 GMT
From: akay@sharp.co.uk (Andrew Kay)
Message-Id: <199902221456.OAA15626@byrd.sharp.co.uk>
To: caml-list@inria.fr
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



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:20 MET