|
1 | 1 | ;;; exceptions.ss
|
2 | 2 | ;;; Copyright 1984-2017 Cisco Systems, Inc.
|
3 |
| -;;; |
| 3 | +;;; |
4 | 4 | ;;; Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | ;;; you may not use this file except in compliance with the License.
|
6 | 6 | ;;; You may obtain a copy of the License at
|
7 |
| -;;; |
| 7 | +;;; |
8 | 8 | ;;; http://www.apache.org/licenses/LICENSE-2.0
|
9 |
| -;;; |
| 9 | +;;; |
10 | 10 | ;;; Unless required by applicable law or agreed to in writing, software
|
11 | 11 | ;;; distributed under the License is distributed on an "AS IS" BASIS,
|
12 | 12 | ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
94 | 94 | [(message-condition? c)
|
95 | 95 | (let ([irritants (if (irritants-condition? c) (condition-irritants c) '())])
|
96 | 96 | (case (and (list? irritants) (length irritants))
|
97 |
| - [(0) |
| 97 | + [(0) |
98 | 98 | ($report-string op
|
99 | 99 | (and prefix? (if (warning-only? c) "warning" "exception"))
|
100 | 100 | (and (who-condition? c) (condition-who c))
|
@@ -263,37 +263,27 @@ TODO:
|
263 | 263 | (set-who! $guard
|
264 | 264 | (lambda (supply-else? guards body)
|
265 | 265 | (if supply-else?
|
266 |
| - ((call/cc |
267 |
| - (lambda (kouter) |
268 |
| - (let ([original-handler-stack ($current-handler-stack)]) |
269 |
| - (with-exception-handler |
270 |
| - (lambda (arg) |
271 |
| - ((call/cc |
| 266 | + (call/cc |
| 267 | + (lambda (kouter) |
| 268 | + (let ([original-handler-stack ($current-handler-stack)]) |
| 269 | + (with-exception-handler |
| 270 | + (lambda (arg) |
| 271 | + (call/cc |
272 | 272 | (lambda (kinner)
|
273 |
| - (kouter |
| 273 | + (call-in-continuation kouter |
274 | 274 | (lambda ()
|
275 | 275 | (guards arg
|
276 | 276 | (lambda ()
|
277 |
| - (kinner |
| 277 | + (call-in-continuation kinner |
278 | 278 | (lambda ()
|
279 | 279 | (parameterize ([$current-handler-stack original-handler-stack])
|
280 |
| - (raise-continuable arg)))))))))))) |
281 |
| - (lambda () |
282 |
| - (call-with-values |
283 |
| - body |
284 |
| - (case-lambda |
285 |
| - [(x) (lambda () x)] |
286 |
| - [vals (lambda () (apply values vals))])))))))) |
287 |
| - ((call/cc |
288 |
| - (lambda (k) |
289 |
| - (with-exception-handler |
290 |
| - (lambda (arg) (k (lambda () (guards arg)))) |
291 |
| - (lambda () |
292 |
| - (call-with-values |
293 |
| - body |
294 |
| - (case-lambda |
295 |
| - [(x) (lambda () x)] |
296 |
| - [vals (lambda () (apply values vals))])))))))))) |
| 280 | + (raise-continuable arg))))))))))) |
| 281 | + body)))) |
| 282 | + (call/cc |
| 283 | + (lambda (k) |
| 284 | + (with-exception-handler |
| 285 | + (lambda (arg) (call-in-continuation k (lambda () (guards arg)))) |
| 286 | + body)))))) |
297 | 287 | )
|
298 | 288 |
|
299 | 289 | (define-syntax guard
|
@@ -471,7 +461,7 @@ TODO:
|
471 | 461 | ;;; defining its child types, even though the system is compiled with
|
472 | 462 | ;;; (eval-syntax-expanders-when) not including compile.
|
473 | 463 | (begin
|
474 |
| -(let-syntax ([a (syntax-rules () |
| 464 | +(let-syntax ([a (syntax-rules () |
475 | 465 | [(_ &condition) ; leave only &condition visible
|
476 | 466 | (define-record-type (&condition make-simple-condition simple-condition?)
|
477 | 467 | (nongenerative #{&condition oyb459ue1fphfx4-a}))])])
|
@@ -706,7 +696,7 @@ TODO:
|
706 | 696 | (for-each
|
707 | 697 | (lambda (m) (unless (string? m) ($oops who "~s is not a string" m)))
|
708 | 698 | messages)
|
709 |
| - (error-help #f who #f |
| 699 | + (error-help #f who #f |
710 | 700 | (if (null? messages) "invalid syntax" (apply string-append messages))
|
711 | 701 | #f (make-syntax-violation form #f))))
|
712 | 702 |
|
|
0 commit comments