caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Strange matching-problem... ?!
@ 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
  0 siblings, 2 replies; 3+ messages in thread
From: Oliver Bandel @ 2005-01-27 12:20 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-27 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-27 12:20 Strange matching-problem... ?! Oliver Bandel
2005-01-27 12:31 ` [Caml-list] " Ville-Pertti Keinonen
2005-01-27 12:33 ` Frederic van der Plancke

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