Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: Francois Berenger <berenger@riken.jp>
Cc: OCaML List Mailing <caml-list@inria.fr>
Subject: Re: [Caml-list] Warning 20: Unused function argument
Date: Mon, 25 Mar 2013 15:08:48 +0900	[thread overview]
Message-ID: <67C58E5F-89D5-4800-B227-22DEA5F92B5B@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <514FD96E.9010209@riken.jp>

On 2013/03/25, at 13:58, Francois Berenger <berenger@riken.jp> wrote:

> So, there is no warning about unused formal parameters?
> 
> After some large refactoring of some code, I may have some.
> 
> If I understand correctly:
> 
> # ocaml -w +20
> # let test_w20 x y z = x, y;;
> val test_w20 : 'a -> 'b -> 'c -> 'a * 'b = <fun>
> # test_w20 1 2 3;;
> - : int * int = (1, 2)
> 
> Produces no warning.

You are just using the wrong warning:

$ ocaml -w +27
        OCaml version 4.00.2+dev0-2012-10-03

# let test_w20 x y z = x, y;;
Warning 27: unused variable z.
val test_w20 : 'a -> 'b -> 'c -> 'a * 'b = <fun>

But expect lots of warning in legacy code, as it warns
about _all_ unused variables, including inside
pattern-matching.

	Jacques

      reply	other threads:[~2013-03-25  6:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22  9:02 Francois Berenger
2013-03-22  9:05 ` Gabriel Scherer
2013-03-22  9:14   ` rixed
2013-03-22  9:16   ` Francois Berenger
2013-03-22  9:39     ` Gabriel Scherer
2013-03-22 10:18 ` Jacques Garrigue
2013-03-25  4:58   ` Francois Berenger
2013-03-25  6:08     ` Jacques Garrigue [this message]

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=67C58E5F-89D5-4800-B227-22DEA5F92B5B@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=berenger@riken.jp \
    --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