caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Ask-if-continue wrapper?
@ 2005-12-28  8:44 Stephen Brackin
  2005-12-28  9:36 ` [Caml-list] " Jonathan Roewen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stephen Brackin @ 2005-12-28  8:44 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

I'd like an OCaml function, which I'll call continueq, with the property
that for any function f with argument(s) fargs,

continueq f fargs tsecs defaultval

starts evaluating f on fargs and lets this evaluation proceed for up to
tsecs seconds. If the computation of (f fargs) completes in this time, then
it returns the result of that computation. Otherwise, it asks the user how
many seconds to let the computation of (f fargs) proceed. If the user inputs
a value less than or equal to 0, then it returns defaultval. If the user
inputs a value tsecs' greater than 0, then it evaluates

continueq f' fargs' tsecs' defaultval

where (f' fargs') denotes the computation state of (f fargs) at the time it
was interrupted.

I want to give the user the option of continuing without having to repeat
earlier calculations. This is similar to the checkpoint utility ckpt, and
similar to the "timeout" function described in the O'Reilly "'Developing
Applications with Objective Caml" reference book, but not quite the same as
either. Will someone please tell me how to do it?

Steve

 


[-- Attachment #2: Type: text/html, Size: 3741 bytes --]

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

end of thread, other threads:[~2005-12-28 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-28  8:44 Ask-if-continue wrapper? Stephen Brackin
2005-12-28  9:36 ` [Caml-list] " Jonathan Roewen
2005-12-28  9:53 ` Florian Weimer
2005-12-28 18:34 ` Xavier Leroy

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