Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* lazy application to Lazy.t
@ 2004-12-07 21:41 Hal Daume III
  2004-12-08  0:29 ` [Caml-list] " Karl Zilles
  0 siblings, 1 reply; 2+ messages in thread
From: Hal Daume III @ 2004-12-07 21:41 UTC (permalink / raw)
  To: Caml Mailing List

suppose I have

  val x : int ref Lazy.t

and I want to 'incr' it, but want to keep it lazy.  i.e., if i start with:

  let x = Lazy.lazy_from_fun (fun () -> ref 0)

then i run my lazy_incr on it, I want:

  let y = Lazy.force x

to return 1

but i only want 'incr' to be run when I Lazy.force x.  is there a way to 
accomplish this?

  

-- 
 Hal Daume III                                   | hdaume@isi.edu
 "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume


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

end of thread, other threads:[~2004-12-08  0:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-07 21:41 lazy application to Lazy.t Hal Daume III
2004-12-08  0:29 ` [Caml-list] " Karl Zilles

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox