caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] lazy vs function for values that are used once at most
@ 2004-06-30 13:31 henri dubois-ferriere
  2004-06-30 13:39 ` Jon Harrop
  0 siblings, 1 reply; 4+ messages in thread
From: henri dubois-ferriere @ 2004-06-30 13:31 UTC (permalink / raw)
  To: Ocaml

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-30 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-30 13:31 [Caml-list] lazy vs function for values that are used once at most henri dubois-ferriere
2004-06-30 13:39 ` Jon Harrop
2004-06-30 14:21   ` henri dubois-ferriere
2004-06-30 14:44     ` Frederic van der Plancke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).