caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Aymeric Fromherz <aymeric.fromherz@ens.fr>
To: caml-list@inria.fr
Subject: [Caml-list] Warning for unused variables
Date: Wed, 22 Feb 2017 20:21:06 +0100	[thread overview]
Message-ID: <58ADE4A2.9060105@ens.fr> (raw)
In-Reply-To: <2432820.aHjfWRbG44@molnar>

Hi,

Using OCaml 4.02.3, I do not have a warning for unused variables when
only one of the variables in a pair is unused.
For instance, the code

let (a,b) = (0, 42) in b;;

raises no warning, while

let (a,b) = (0,42) in 1;; raises the following

Warning 26: unused variable b.
Warning 26: unused variable a.

I would have expected a warning in the first case since a is unused.

Warnings for single unused variables, such as let a = 42 in 1 are still
raised.

What is the reason for this? Is this behaviour intended? How are unused
variables determined?

Thanks in advance,
Aymeric Fromherz

  reply	other threads:[~2017-02-22 19:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 17:01 [Caml-list] List of structurally typed objects Richard W.M. Jones
2017-02-22 17:09 ` Gabriel Scherer
2017-02-22 17:36   ` Richard W.M. Jones
2017-02-22 17:43     ` Nicolás Ojeda Bär
2017-02-22 17:53       ` Richard W.M. Jones
2017-02-22 17:28 ` Damien Guichard
2017-02-22 17:38   ` Richard W.M. Jones
2017-02-22 18:08     ` Ivan Gotovchits
2017-02-22 19:04       ` Mikhail Mandrykin
2017-02-22 19:21         ` Aymeric Fromherz [this message]
2017-02-22 19:43           ` [Caml-list] Warning for unused variables Gabriel Scherer
2017-02-22 19:59             ` Aymeric Fromherz
2017-02-22 20:01               ` Gabriel Scherer
2017-02-22 20:17                 ` Aymeric Fromherz

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=58ADE4A2.9060105@ens.fr \
    --to=aymeric.fromherz@ens.fr \
    --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).