diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2002-07-30 13:02:56 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2002-07-30 13:02:56 +0000 |
commit | 23be5a960fb7913c016291ffde23d17fd4885c18 (patch) | |
tree | d23936eeec62d9155260624d81053345b7903528 | |
parent | 8e809f9bf710820eaf25d6e1b7835d4a18504ae6 (diff) |
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.mli | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/stdlib/lazy.mli b/stdlib/lazy.mli index 10d69432d..afdb1e6d1 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. *) |