|
78 | 78 | log-file) |
79 | 79 | (newline log-file) |
80 | 80 | (flush-output log-file) |
81 | | - (let ([result (with-handlers ([exn:fail? (lambda (exn) (make-gui-exn (exn-message exn)))]) |
82 | | - ;; put the call to fixup-picts in the handlers |
83 | | - ;; so that errors in the user-supplied predicates & |
84 | | - ;; conversion functions show up in the rendered output |
85 | | - (fixup-picts (get-predicate?) |
86 | | - (get-render) |
87 | | - (get-get-width) |
88 | | - (get-get-height) |
89 | | - (eh ev catching-exns? expr)))]) |
90 | | - (write (serialize result) log-file) |
91 | | - (newline log-file) |
92 | | - (flush-output log-file) |
93 | | - (if (gui-exn? result) |
94 | | - (raise (make-exn:fail (gui-exn-message result) (current-continuation-marks))) |
95 | | - result))))] |
| 81 | + (define result |
| 82 | + (with-handlers ([exn:fail? (lambda (exn) (make-gui-exn (exn-message exn)))]) |
| 83 | + ;; put the call to fixup-picts in the handlers |
| 84 | + ;; so that errors in the user-supplied predicates & |
| 85 | + ;; conversion functions show up in the rendered output |
| 86 | + (fixup-picts (get-predicate?) |
| 87 | + (get-render) |
| 88 | + (get-get-width) |
| 89 | + (get-get-height) |
| 90 | + (eh ev catching-exns? expr)))) |
| 91 | + (write (serialize result) log-file) |
| 92 | + (newline log-file) |
| 93 | + (flush-output log-file) |
| 94 | + (if (gui-exn? result) |
| 95 | + (raise (make-exn:fail (gui-exn-message result) (current-continuation-marks))) |
| 96 | + result)))] |
96 | 97 | [else |
97 | 98 | (define log-file |
98 | 99 | (with-handlers ([exn:fail:filesystem? (lambda (exn) (open-input-string ""))]) |
|
103 | 104 | (if catching-exns? |
104 | 105 | (raise exn) |
105 | 106 | (void)))]) |
106 | | - (let ([v (read log-file)]) |
107 | | - (if (eof-object? v) |
108 | | - (error "expression not in log file") |
109 | | - (let ([v (deserialize v)]) |
110 | | - (if (equal? v |
111 | | - (if (syntax? expr) |
112 | | - (syntax->datum expr) |
113 | | - expr)) |
114 | | - (let ([v (read log-file)]) |
115 | | - (if (eof-object? v) |
116 | | - (error "expression result missing in log file") |
117 | | - (let ([v (deserialize v)]) |
118 | | - (if (gui-exn? v) |
119 | | - (raise (make-exn:fail (gui-exn-message v) |
120 | | - (current-continuation-marks))) |
121 | | - v)))) |
122 | | - (error 'mreval |
123 | | - "expression does not match log file: ~e versus: ~e" |
124 | | - expr |
125 | | - v))))))))])) |
| 107 | + (define v (read log-file)) |
| 108 | + (if (eof-object? v) |
| 109 | + (error "expression not in log file") |
| 110 | + (let ([v (deserialize v)]) |
| 111 | + (if (equal? v |
| 112 | + (if (syntax? expr) |
| 113 | + (syntax->datum expr) |
| 114 | + expr)) |
| 115 | + (let ([v (read log-file)]) |
| 116 | + (if (eof-object? v) |
| 117 | + (error "expression result missing in log file") |
| 118 | + (let ([v (deserialize v)]) |
| 119 | + (if (gui-exn? v) |
| 120 | + (raise (make-exn:fail (gui-exn-message v) |
| 121 | + (current-continuation-marks))) |
| 122 | + v)))) |
| 123 | + (error 'mreval "expression does not match log file: ~e versus: ~e" expr v)))))))])) |
126 | 124 |
|
127 | 125 | (define image-counter 0) |
128 | 126 |
|
|
0 commit comments