summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2002-07-30 13:02:56 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2002-07-30 13:02:56 +0000
commit23be5a960fb7913c016291ffde23d17fd4885c18 (patch)
treed23936eeec62d9155260624d81053345b7903528
parent8e809f9bf710820eaf25d6e1b7835d4a18504ae6 (diff)
downloadocaml-23be5a960fb7913c016291ffde23d17fd4885c18.tar.gz
Documenter le probleme avec let rec x = lazy x
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5057 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--stdlib/lazy.mli8
1 files changed, 8 insertions, 0 deletions
diff --git a/stdlib/lazy.mli b/stdlib/lazy.mli
index 10d69432d2..afdb1e6d17 100644
--- a/stdlib/lazy.mli
+++ b/stdlib/lazy.mli
@@ -26,6 +26,14 @@ type 'a t = 'a lazy_t;;
Note: [lazy_t] is the built-in type constructor used by the compiler
for the [lazy] keyword. You should not use it directly. Always use
[Lazy.t] instead.
+
+ Note: if the program is compiled with the [-rectypes] option,
+ ill-founded recursive definitions of the form [let rec x = lazy x]
+ or [let rec x = lazy(lazy(...(lazy x)))] are accepted by the type-checker
+ and lead, when forced, to ill-formed values that trigger infinite
+ loops in the garbage collector and other parts of the run-time system.
+ Without the [-rectypes] option, such ill-founded recursive definitions
+ are rejected by the type-checker.
*)