From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 2B49CBB81 for ; Wed, 28 Dec 2005 09:44:35 +0100 (CET) Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jBS8iYV3012400 for ; Wed, 28 Dec 2005 09:44:34 +0100 Received: from Nodens ([71.255.44.175]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IS700AHU9M4TKT2@vms042.mailsrvcs.net> for caml-list@yquem.inria.fr; Wed, 28 Dec 2005 02:44:33 -0600 (CST) Date: Wed, 28 Dec 2005 03:44:29 -0500 From: "Stephen Brackin" Subject: Ask-if-continue wrapper? To: Message-id: <0IS700AHX9M9TKT2@vms042.mailsrvcs.net> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: multipart/alternative; boundary="----=_NextPart_000_0000_01C60B61.026C67F0" Thread-index: AcYLiuqDv53EU8yuQbCjZnoPvhEuBA== X-Miltered: at concorde with ID 43B25072.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 inputs:01 inputs:01 denotes:01 o'reilly:01 ocaml:01 denotes:01 verizon:98 computation:01 computation:01 argument:01 argument:01 caml:02 objective:02 objective:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_60_70,HTML_MESSAGE autolearn=disabled version=3.0.3 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C60B61.026C67F0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0000_01C60B61.026C67F0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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

 

------=_NextPart_000_0000_01C60B61.026C67F0--