Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] lazy vs function for values that are used once at most
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: henri dubois-ferriere <henridf@g...>
Subject: [Caml-list] lazy vs function for values that are used once at most
hi, 

when one has a value v that is going to be either used 0 or 1 time, is
there any difference in terms of overhead (ie for building the
closure,  GC performance, etc) between passing around  (lazy v) and
then forcing the value if needed, or passing around (fun () -> v) and
evaluating f when needed?

i would guess these are equivalent overhead-wise but maybe there's
more to it than meets the eye.

thanks
henri

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