Hi guys,

Have a little problem. I perform some experiments with genetic programming and need to disable all output from a randomly-generated program (need only its return value).

For this purpose I wrote the following macro:

(defmacro sandbox (&body body)
  `(ignore-errors
     (locally (declare #+sbcl(sb-ext:muffle-conditions warning))
       ,@body)))

This approach works good for me, except macro expansion errors (unfortunately lambda is a macro). For example, when I input:

(sandbox (lambda))

I get annoying error message:

; in: LAMBDA NIL
;     (LAMBDA)
;
; caught ERROR:
;   (in macroexpansion of (LAMBDA))
;   (hint: For more precise location, try *BREAK-ON-SIGNALS*.)
;   error while parsing arguments to DEFMACRO LAMBDA:
;     invalid number of elements in
;       ()
;     to satisfy lambda list
;       (&WHOLE SB-IMPL::WHOLE SB-IMPL::ARGS &BODY SB-IMPL::BODY):
;     at least 1 expected, but 0 found
;
; compilation unit finished
;   caught 1 ERROR condition

Redirecting *standard-output* or *error-output* does not help here. Could you suggest me some workaround? Thanks in advance.