Browse thread
Strange matching-problem... ?!
-
Oliver Bandel
- Frederic van der Plancke
- Ville-Pertti Keinonen
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2005-01-27 (12:31) |
From: | Frederic van der Plancke <fvdp@d...> |
Subject: | Re: [Caml-list] Strange matching-problem... ?! |
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