Re: How to handle endless loops of Interpreter.eval()?

Matthias Radestock <[email protected]>
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
"Marco Bakera" <[email protected]> writes:

> I have some problem handling endless loops produced by
> Interpreter.eval(). How is it possible to stop some evaluation of the
> Interpreter after a certain amount of time - e.g. after some time out
> occured?

Take a look at the code for sarahbot, the irc bot that, amongst other
things, contains a sandboxed, resource-constrained Scheme evaluator.

You can find the code in the 'contrib' cvs module, under the 'irc'
directory.

Regarding your specific query, sarahbot has an |eval-within-n-ms|
procedure, defined in contrib/irc/scheme/sarah/plugins/scheme.scm.


Matthias.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.