Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
is this a bug ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-05-09 (18:24)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] is this a bug ?
> You found an semantic problem in the gramar ^^
> or-patterns do not play well with "when"
> I think it's a bug in the semantics...

I don't believe so. It depends on the type. In fact, it works very
well with sum types (I did a very small inference engine which used or
patterns with when to great effect).

The problem is the two match clauses are not different. They look
different for the fact that the variables are bound in a different
order -- which is why the warning occurs. For matching, variable
naming has no semantic impact, hence the confusion.