diff options
author | Alain Frisch <alain@frisch.fr> | 2011-12-22 09:30:51 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2011-12-22 09:30:51 +0000 |
commit | ec02bc1f8d95bd8f7e0d1a5de0f79fa280b8afa1 (patch) | |
tree | c576533f2c9d4df87c4b0e50f301bf9e8ea705b1 | |
parent | 5c0f191601d10218e7d33e721c745b58a782939c (diff) |
Clarify doc about Oo.id (#5436).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11933 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | stdlib/oo.mli | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/stdlib/oo.mli b/stdlib/oo.mli index cd83151bb..508217228 100644 --- a/stdlib/oo.mli +++ b/stdlib/oo.mli @@ -17,11 +17,17 @@ val copy : (< .. > as 'a) -> 'a (** [Oo.copy o] returns a copy of object [o], that is a fresh - object with the same methods and instance variables as [o] *) + object with the same methods and instance variables as [o]. *) external id : < .. > -> int = "%field1" (** Return an integer identifying this object, unique for - the current execution of the program. *) + the current execution of the program. The generic comparison + and hashing functions are based on this integer. When an object + is obtained by unmarshaling, the id is refreshed, and thus + different from the original object. As a consequence, the internal + invariants of data structures such as hash table or sets containing + objects are broken after unmarshaling the data structures. + *) (**/**) (** For internal use (CamlIDL) *) |