[racket] how to get sandbox to drop errors

From: Michael Wilber (mwilber at uccs.edu)
Date: Fri Apr 12 16:17:05 EDT 2013

You're evaluating the (/ 1 0) before you make your evaluator. You have
to quote it.

The following works for me:

(define my-eval
  (parameterize ([sandbox-output #f]
                 [sandbox-error-output #f]
                 [sandbox-propagate-exceptions #f]
                 [sandbox-propagate-breaks #f])
    (make-evaluator 'racket)))
(my-eval '(/ 1 0))

Stephen Chang <stchang at ccs.neu.edu> writes:
> How do I get a sandbox to drop errors? The following code still
> produces the divide by 0 exception. What am I doing wrong?
>
> #lang racket
>
> (require racket/sandbox)
>
> (parameterize ([sandbox-output #f]
>                [sandbox-error-output #f]
>                [sandbox-propagate-exceptions #f]
>                [sandbox-propagate-breaks #f])
>   (make-evaluator 'racket (/ 1 0)))
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.