Projects : gscm : gscm_genesis
1 | (define (run filename) |
2 | (define port (open-input-file filename)) |
3 | (define restart #f) |
4 | (define (loop) |
5 | (let* ((name (read port)) |
6 | (form (read port))) |
7 | (if (eof-object? form) (close-input-port port) |
8 | (begin (set-error-handler! |
9 | (lambda (msg args trace-log) |
10 | (write `(pass ,name ,msg . ,args)) |
11 | (newline) |
12 | (restart '()))) |
13 | (write `(fail ,name ,(eval form (interaction-environment)))) |
14 | (newline) |
15 | (loop))))) |
16 | (call-with-current-continuation (lambda (c) (set! restart c))) |
17 | (loop)) |
18 | |
19 | (run "semantic-bad.scm") |