[plt-scheme] restart exception handling?
On Jul 13, Matthew Flatt wrote:
> [...]
>
> (define (mega-fun x y z)
> (let ([x (if (not (integer? x))
> (raise-continuable-type-error 'mega-fun "integer" x)
> x)])
> (let ([y (if (not (list? y)) ....)])
> ....)))
You mean
(define (mega-fun x y z)
(let ([x (let loop ([x x])
(if (not (integer? x))
(loop (raise-continuable-type-error 'mega-fun "integer" x))
x))])
...))
[which could be asbtracted by some
(define (must-be-integer who x)
(if (integer? x)
x
(must-be-integer (raise-continuable-type-error who "integer" x))))
]
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!