Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Andre Nathan <andre@digirati.com.br>
To: caml-list@inria.fr
Subject: Labeled arguments and polymorphic return types
Date: Sat, 11 Aug 2007 15:17:32 -0300	[thread overview]
Message-ID: <1186856252.6007.11.camel@homesick> (raw)

Hello

Consider the following definition:

# let f ~a = print_int a; raise Exit;;
val f : a:int -> 'a = <fun>

If I call f without using the argument label, I get the following
warning:

# f 1;;
Warning X: this argument will not be used by the function.
- : a:int -> 'a = <fun>

The call works if I use the label ("f ~a:1"), if I define f without a
label for its argument, or if I remove the "raise" statement (causing
the return value to be unit instead of 'a).

Why is this warning generated?

Thanks in advance,
Andre


             reply	other threads:[~2007-08-11 18:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-11 18:17 Andre Nathan [this message]
2007-08-13  8:51 ` [Caml-list] " Jacques Garrigue
2007-08-13 15:53   ` Andre Nathan

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=1186856252.6007.11.camel@homesick \
    --to=andre@digirati.com.br \
    --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