caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@inria.fr
Subject: Strange matching-problem... ?!
Date: Thu, 27 Jan 2005 13:20:34 +0100	[thread overview]
Message-ID: <1106828434.41f8dc9213b6e@webmail.in-berlin.de> (raw)

Hello,

any idea about this?!





# type foobar = Foo | Bar;;
type foobar = Foo | Bar

# match Foo with
   Foo -> "foo"
  | Bar -> "bar";;
- : string = "foo"

# match Foo with
   _Foo -> "foo"
  |Bar -> "bar";;
Warning: this match case is unused.
- : string = "foo"

# match Foo with
  _ Foo -> "foo"
  | Bar -> "bar";;
Syntax error

# 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.

Using such things like _Foo instead of Foo
does not yield any error message, but when defining
the type with _Foo then ocaml complains about my
wrong syntax.

What's going on here and why?

TIA,
   Oliver


             reply	other threads:[~2005-01-27 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-27 12:20 Oliver Bandel [this message]
2005-01-27 12:31 ` [Caml-list] " Ville-Pertti Keinonen
2005-01-27 12:33 ` Frederic van der Plancke

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=1106828434.41f8dc9213b6e@webmail.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --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).