[
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: | Remi VANICAT <vanicat@l...> |
| Subject: | Re: [Caml-list] lazy lists |
Michael Vanier <mvanier@cs.caltech.edu> writes: > What's the best way to write a lazy list data type in ocaml? I've been > playing around with this datatype (from an old mailing list posting): > > type 'a stream = > Nil > | Cons of 'a Lazy.t * 'a stream Lazy.t > > but I can't figure out how to write a "stream_cons" function. you mean : let stream_cons x y = lazy Cons (x, y) > Also, it > appears that the Lazy.t data type uses references; why is this? Because it is the standard way of doing it with a non lazy language... -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- 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