caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Aymeric Fromherz <aymeric.fromherz@ens.fr>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Warning for unused variables
Date: Wed, 22 Feb 2017 14:43:19 -0500	[thread overview]
Message-ID: <CAPFanBHPX-Fw+EJ-Sh2csVFwetHnF=5KiAZnxopna1D2TBuyCA@mail.gmail.com> (raw)
In-Reply-To: <58ADE4A2.9060105@ens.fr>

This would be a bug, but I cannot reproduce it on my machine, where
all OCaml versions I have (including 4.02.3) raise a warning as
expected.

On Wed, Feb 22, 2017 at 2:21 PM, Aymeric Fromherz
<aymeric.fromherz@ens.fr> wrote:
> 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
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

  reply	other threads:[~2017-02-22 19:44 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         ` [Caml-list] Warning for unused variables Aymeric Fromherz
2017-02-22 19:43           ` Gabriel Scherer [this message]
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='CAPFanBHPX-Fw+EJ-Sh2csVFwetHnF=5KiAZnxopna1D2TBuyCA@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=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).