PasteRack.org
Paste # 66137
2017-10-11 11:07:45

Fork as a new paste.

Paste viewed 160 times.


Embed:

scribble/example diverging function

  1. #lang scribble/manual
  2. @require[racket/sandbox scribble/example]
  3.  
  4. @(define TIMEOUT-SECONDS 3)
  5.  
  6. @(define my-evaluator
  7.    (parameterize ([sandbox-output 'string]
  8.                   [sandbox-error-output 'string]
  9.                   [sandbox-eval-limits (list TIMEOUT-SECONDS #f)])
  10.      (make-evaluator 'racket/base)))
  11.  
  12. @examples[#:eval my-evaluator
  13.   (define (diverge)
  14.     (diverge))
  15.  
  16.   (eval:error (diverge))
  17. ]

=>