[racket] Checking infinite loops

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Oct 3 18:31:38 EDT 2010

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!

Posted on the users mailing list.