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: -- (:)
From: Keith Wansbrough <Keith.Wansbrough@c...>
Subject: Re: [Caml-list] Recursive lists

> Can some functions of the List library support the use of the recursive 
> lists?
> I mean: can some scanning functions such as map, for_all, exists, mem, 
> filter, and so on understand if they are working on recursive lists and 
> act correctly without going in buffer overflow or infinite loops?

How could they do this?  It's just a list; there's nothing special
about it, except that it has no end.

You might be able to do it by keeping a list of all the nodes you've 
visited, and using physical equality to check if you have already 
visited a node.  But it would be better to design a more appropriate 
data structure for your application, one for which such tricks are not 

What are you trying to do?

--KW 8-)

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