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
Intended behavior of GenerateMap
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-06-24 (12:32)
From: Frédéric_Gava <gava@u...>
Subject: Re: [Caml-list] Anti-matching
David Thomas a écrit :
> Isn't "!(x) -> a | _ -> b" the same as "x -> b | _ ->
> a"?  I don't really see much of a benefit, at the cost
> (I assume) of complexity.

In this case, yes. But you can express interesting (more easier) thinks 
as (examples of TOM)

!f(x,x) -> // matches either something different from f, or an f with x1 
!= x2

f(x,!g(x)) -> {
       // matches an f which has either x2!=g or x2=g(y) with y != x1

You can simulating this using classical pattern matching. So I thinks 
that is possible using camlp4. But, looking for someone you have do this 
work or plan to do this.