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] Recursive lists
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-10-08 (17:18)
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 
evaluation. After all, a cyclic list is semantically equivalent to an 
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.


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