caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: akay@sharp.co.uk (Andrew Kay)
To: caml-list@inria.fr
Subject: Re: Warnings in ocaml
Date: Mon, 22 Feb 1999 14:56:01 GMT	[thread overview]
Message-ID: <199902221456.OAA15626@byrd.sharp.co.uk> (raw)


> 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




             reply	other threads:[~1999-02-22 17:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-22 14:56 Andrew Kay [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-02-22 17:25 Don Syme
1999-02-22 18:16 ` Pierre Weis
1999-02-22 13:45 Andrew Kay
1999-02-22  9:55 Frank A. Christoph
1999-02-22 12:36 ` Xavier Leroy
1999-02-22 13:24   ` Anton Moscal
1999-02-22 15:06   ` Michael Hicks
1999-02-22 18:33 ` Ching-Tsun Chou
1999-02-19 12:30 Jacques GARRIGUE
1999-02-19 18:32 ` Pierre Weis
1999-02-20 10:45   ` Markus Mottl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199902221456.OAA15626@byrd.sharp.co.uk \
    --to=akay@sharp.co.uk \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).