From: Frederic van der Plancke <fvdp@decis.be>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Strange matching-problem... ?!
Date: Thu, 27 Jan 2005 12:33:32 +0000 [thread overview]
Message-ID: <41F8DF9C.72F888C0@decis.be> (raw)
In-Reply-To: <1106828434.41f8dc9213b6e@webmail.in-berlin.de>
Oliver Bandel wrote:
> # match Foo with
> _Bar -> "bar"
> | Foo -> "foo";;
> Warning: this match case is unused.
> - : string = "bar"
>
> # type foobar2 = _Foo | Bar;;
> Syntax error
> #
>
> Why is the second match working without any error message?
> Did I ovelooked something?
>
> I found that behaviour, after I tried to
> use Sumtypes starting with an "_" in the name.
Doesn't _ work as a lowercase letter ?
Then _Foo and _Bar are not valid sum type tags, but they are valid
variable names hence
match Foo with
_Bar -> "bar"
| Foo -> "foo";;
works exactly like
match Foo with
x -> "bar"
| Foo -> "foo";;
would.
Frédéric
prev parent reply other threads:[~2005-01-27 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-27 12:20 Oliver Bandel
2005-01-27 12:31 ` [Caml-list] " Ville-Pertti Keinonen
2005-01-27 12:33 ` Frederic van der Plancke [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=41F8DF9C.72F888C0@decis.be \
--to=fvdp@decis.be \
--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