(define (run filename) (define port (open-input-file filename)) (define restart #f) (define (loop) (let* ((name (read port)) (form (read port))) (if (eof-object? form) (close-input-port port) (begin (set-error-handler! (lambda (msg args trace-log) (write `(pass ,name ,msg . ,args)) (newline) (restart '()))) (write `(fail ,name ,(eval form (interaction-environment)))) (newline) (loop))))) (call-with-current-continuation (lambda (c) (set! restart c))) (loop)) (run "semantic-bad.scm")