Browse thread
[Caml-list] Recursive lists
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Wolfgang Lux <wlux@u...> |
| Subject: | Re: [Caml-list] Recursive lists |
Alex Baretta wrote: > Lists can be recursive. This means that the list type models a set of > values which includes the cyclic lists. The ocaml type system allow > both for such values and for functions manipulating them, so it's > perfectly natural to expect the List module to treat cyclic lists > correctly. IMHO it is absolutely not natural to expect this in a language with eager evaluation. After all, a cyclic list is semantically equivalent to an infinite value, i.e., it is equivalent to bottom. And we all know that f bottom = bottom in a strict language. In addition, have a look at the manual which clearly states (Sect. 6.7.1) that the behavior of let rec for non-functional values like let rec l2 = 100 :: l2 is implementation dependent. Regards Wolfgang ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners