- Original Message
> From: Robby Findler
> (with-handlers ([exn:fail? (lambda (exn) put-specified-default-here)])
> try-something-here)
That's the fellow!
Here's a little convenience macro I defined:
(define-syntax catch-errors
(syntax-rules ()
((catch-all error-v
I think you want with-handlers.
(with-handlers ([exn:fail? (lambda (exn) put-specified-default-here)])
try-something-here)
Robby
On Sun, Sep 5, 2010 at 7:36 AM, Mark Carter wrote:
> I can't get my head around Racket's exception mechanism. I want to say "try
> something, and if it fails, retu
I can't get my head around Racket's exception mechanism. I want to say "try
something, and if it fails, return a specified default value".
This returns the expected result:
(with-exception-handler (lambda (x) "Oops") (/ 1 0))
because it returns "Oops". However, if I type
(with-exception-han
3 matches
Mail list logo