From: Yann Coscoy <Yann.Coscoy@trusted-logic.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Warning: this match case is unused.
Date: Thu, 08 Nov 2001 17:21:32 +0100 [thread overview]
Message-ID: <3BEAB10C.9000709@trusted-logic.fr> (raw)
In-Reply-To: <3BEAB901.19333.21ACF8D8@localhost>
Rolf Wester wrote:
> Hi,
>
> this is probably a trivial question but can someone tell me why:
>
> let f l n0 =
> let n = List.length l in
> match n with
> n0 -> 1;
> | _ -> 0;;
>
> Results in:
> Warning: this match case is unused.
The second n0 in pattern « n0 -> 1 » is the introduction of a fresh
variable. It is not binded to n0 previously introduced in « f l n0 = ».
I guess the function you had in mind is:
let f l n0 =
let n = List.length l in
match n with
n1 when n1=n0 -> 1;
| _ -> 0;;
--
Yann Coscoy - Trusted Logic
5 rue du Bailliage 78000 Versailles
+33 (0) 1 30 97 74 76
http://www.trusted-logic.fr
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
next prev parent reply other threads:[~2001-11-08 16:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-08 14:55 Rolf Wester
2001-11-08 16:14 ` Pixel
2001-11-08 16:21 ` Yann Coscoy [this message]
2001-11-08 16:29 Krishnaswami, Neel
2001-11-09 6:39 Rolf Wester
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=3BEAB10C.9000709@trusted-logic.fr \
--to=yann.coscoy@trusted-logic.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