[racket] Checking infinite loops

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Oct 3 18:39:34 EDT 2010

How does it do on this program:

  (begin (sleep 5) 'done)

?

Robby

On Sun, Oct 3, 2010 at 5:31 PM, Eli Barzilay <eli at barzilay.org> wrote:
> An hour ago, A Z wrote:
>> Hello,
>>
>> Does anybody know how to check for infinite loops programmatically in
>> racket?
>
> -> (require racket/sandbox)
> -> (sandbox-eval-limits '(4 10)) ; 4sec 10mb
> -> (define e (make-evaluator 'racket))
> -> (e '((lambda (x) (x x)) (lambda (x) (x x))))
> with-limit: out of time
> -> (e '((call/cc call/cc) (call/cc call/cc))) ; for shriram
> with-limit: out of time
> -> (e '((lambda (x) (x x)) (lambda (x) (cons 1 (x x)))))
> evaluator: terminated (out-of-memory)
>
> --
>          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                    http://barzilay.org/                   Maze is Life!
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>


Posted on the users mailing list.