Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: henri dubois-ferriere <henridf@gmail.com>
To: Ocaml <caml-list@inria.fr>
Subject: [Caml-list] lazy vs function for values that are used once at most
Date: Wed, 30 Jun 2004 15:31:47 +0200	[thread overview]
Message-ID: <d61254fb04063006314bd9ee5a@mail.gmail.com> (raw)

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


             reply	other threads:[~2004-06-30 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-30 13:31 henri dubois-ferriere [this message]
2004-06-30 13:39 ` Jon Harrop
2004-06-30 14:21   ` henri dubois-ferriere
2004-06-30 14:44     ` Frederic van der Plancke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d61254fb04063006314bd9ee5a@mail.gmail.com \
    --to=henridf@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox