Browse thread
[Caml-list] Recursive lists
-
Luca Pascali
- Keith Wansbrough
- Sébastien_Furic
- sejourne_kevin
[
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: | 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 needed. What are you trying to do? --KW 8-) ------------------- 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