Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Lazy vs closure
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kenneth Knowles <kknowles@b...>
Subject: Re: [Caml-list] Lazy vs closure

On Wed, May 19, 2004 at 07:10:21PM +1000, skaller wrote:
> Is there any difference semantically?

Yes, since lazy values are not recomputed.

# let l = lazy (print_string "hello");;
val l : unit lazy_t = <lazy>
# Lazy.force l;;
hello- : unit = ()
# Lazy.force l;;
- : unit = ()

Kenn

-------------------
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