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.5 required=5.0 tests=AWL,HTML_MESSAGE, MAILTO_TO_SPAM_ADDR,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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 137B5BBCA for ; Sat, 16 Feb 2008 22:49:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAN7otkfAXQInh2dsb2JhbACCPDWNYwEBAQgKKYEVlAWFfw X-IronPort-AV: E=Sophos;i="4.25,363,1199660400"; d="scan'208";a="8168265" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 16 Feb 2008 22:49:37 +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 m1GLnZYn001600 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 16 Feb 2008 22:49:37 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACvptkfRVZK2kmdsb2JhbACCPDWNYwEBAQEHBAQJChaBF5QGhXw X-IronPort-AV: E=Sophos;i="4.25,363,1199660400"; d="scan'208";a="22704725" Received: from wa-out-1112.google.com ([209.85.146.182]) by mail4-smtp-sop.national.inria.fr with ESMTP; 16 Feb 2008 22:49:36 +0100 Received: by wa-out-1112.google.com with SMTP id m34so2058005wag.9 for ; Sat, 16 Feb 2008 13:49:35 -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:in-reply-to:mime-version:content-type:references; bh=KW+rXhVdxIKLXhHk46QhYck+WHMqzL7naMF+hZ0/+8Q=; b=mr11ErmuQAOC298jxLYH8Do4PX8PjybHjc0A0GCZ5veWRsSXOmY/QaVGmhnd3x5+WD2514sf1Ie0uz8NVG4YthzPThtUgXn6jSlXz0ByBCD0wcJAgU9Oiv+9e+06jFX2cZdDO2JVeuS+wtZ5tVRUYfKt9yu9660YwkERQ7TANHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=FJM4ukdjoJW0KwKt8oiFQQPtFCxKwpWULBrtso1Z1c4TxZAm9GXcr6DksMjHDaDrWrZ+jfcb3RPkiobSUFgaW5u16LthIpacRsGO4MR/kAMXwWboFQgO66z1TkxqWSxXc8awZjSFFjk5umTpy1yo4Oe+qi1tUDWNirJM2EF7OGo= Received: by 10.115.22.1 with SMTP id z1mr176627wai.33.1203198575619; Sat, 16 Feb 2008 13:49:35 -0800 (PST) Received: by 10.114.182.17 with HTTP; Sat, 16 Feb 2008 13:49:35 -0800 (PST) Message-ID: Date: Sat, 16 Feb 2008 15:49:35 -0600 From: "Angela Zhu" To: caml-list@inria.fr Subject: Re: [Caml-list] Cancel button or Status bar In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7029_32902537.1203198575614" References: X-Miltered: at concorde with ID 47B75A6F.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 ocaml:01 o'reilly's:01 oreilly-book:01 angela:98 angela:98 22.:98 threads:01 threads:01 wrote:01 wrote:01 ------=_Part_7029_32902537.1203198575614 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Dominique! I was not using threads but I think it is a good idea. Best regards, Angela On Feb 16, 2008 11:26 AM, Dominique Martinet wrote: > 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 > ------=_Part_7029_32902537.1203198575614 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Dominique!

I was not using threads but I think it is a good idea.

Best regards,
Angela


On Feb 16, 2008 11:26 AM, Dominique Martinet <asmadeus77@gmail.com> wrote:
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


------=_Part_7029_32902537.1203198575614--