From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id DA801BBCA for ; Sat, 16 Feb 2008 18:26:34 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJCrtkfAXQInh2dsb2JhbACQUwEBAQgKKYEVlD2GBQ X-IronPort-AV: E=Sophos;i="4.25,362,1199660400"; d="scan'208";a="9265751" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 16 Feb 2008 18:26:34 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1GHQXnE028967 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 16 Feb 2008 18:26:34 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADurtkdA6aa2i2dsb2JhbACQUwEBAQgEBAkKEQWBF5Q7hgU X-IronPort-AV: E=Sophos;i="4.25,362,1199660400"; d="scan'208";a="22702000" Received: from py-out-1112.google.com ([64.233.166.182]) by mail4-smtp-sop.national.inria.fr with ESMTP; 16 Feb 2008 18:26:33 +0100 Received: by py-out-1112.google.com with SMTP id u52so1303862pyb.10 for ; Sat, 16 Feb 2008 09:26:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=34TI/QW7dXq6lGWWMIsRI1jIosWcSufeQYoUw/TPEGs=; b=fOzO3SbiEr9FCzPFW63lBJcktywXAI79MH5lC6bsfK6ea3QPKw+hDAw5KKacxafzO6pHhcpjfaRM4Ee4rEGj2Wg5lVXR2FkZV0gQWAtNYVdk5LgBQYMFEzWU/jeNo3e3RTtd9PL31issSjJszdQPpt8+eR63rM0P21HFxN9qIl4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=j7CXejW1/mvqyA8JIL0hQY9AFGga0V2RChd8IrUni6Uuhdzh2mKWmO/VJyOqAcVfFDeeG3eoLdRnn9mAViifTXU9o1XQrrzr1BujgeIQNANMYKM8bbUtNvQTaaDpHk/L93tHP9r7J5S3ybCSzM1w0JCWd8bmvH1w13HEN272m6s= Received: by 10.65.112.5 with SMTP id p5mr6713156qbm.64.1203182791583; Sat, 16 Feb 2008 09:26:31 -0800 (PST) Received: by 10.65.22.2 with HTTP; Sat, 16 Feb 2008 09:26:31 -0800 (PST) Message-ID: Date: Sat, 16 Feb 2008 18:26:31 +0100 From: "Dominique Martinet" To: "Angela Zhu" Subject: Re: [Caml-list] Cancel button or Status bar Cc: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Miltered: at concorde with ID 47B71CCA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; martinet:01 ocaml:01 martinet:01 o'reilly's:01 oreilly-book:01 threads:01 threads:01 compile:01 exception:01 caml-list:01 expression:02 caml:02 raise:03 gui:03 gui:03 Hello, If it's an OCaml interpreter, I don't think there's a way to evaluate the time needed automatically, you can compute the complexity yourself and have a rough evaluation of the compile time, but there's no way a computer will do it for you without actually evaluating the expression. The stopping is easy though; if you use a GUI you probably already have threads (i.e. when you click on run, it will call the "eval prog1" function in a thread, so you can keep editing inside of the GUI). You can save the thread id when you run it, and ask to kill it when you click on the stop button, and I don't even think it will raise an exception. If you're not already using threads, I'm curious and would like to know how you plan to handle the GUI. Regards, Martinet Dominique PS : O'Reilly's book is a nice place to start if you don't know much about threads http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora175.html