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
[Caml-list] On the equality of functional values
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Monniaux <David.Monniaux@e...>
Subject: Re: [Caml-list] On the equality of functional values
On Sun, 27 Oct 2002, Alessandro Baretta wrote:

> I typed does not raise the same exception. This seems to 
> imply that comparisons are allowed between functional 
> values, too.

If I remember well, = is implemented by doing first a == (equality of
pointers) test, and returning true if that test succeeds; otherwise,
the more complex recursive equality test is performed, which fails with
an exception if it encounters functional values.

So if x and y are the same closure, x=y succeeds and yields the true
value. Otherwise, it throws an exception.

David Monniaux  
Laboratoire d'informatique de l'École Normale Supérieure,
Paris, France

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: