Re: (warn) isn't doing what I expect it to
- From: Nathan Baum <nathan_baum@xxxxxxxxxxxxxx>
- Date: Mon, 29 Aug 2005 23:15:00 +0100
Wade Humeniuk wrote:
Nathan Baum wrote:
I'm expecting
(handler-case (warn "foo") (warning (c) (muffle-warning c)))
to produce no output, successfully. Instead it produces
*** - INVOKE-RESTART: No restart named MUFFLE-WARNING is visible.
CLHS says WARN establishes a MUFFLE-WARNING restart. What am I doing wrong?
By the time the warning handler is called the stack is already unwound. (There is no muffle-warning restart). You need to use handler-bind instead. With handler-bind the handler is called without unwinding the current stack.
CL-USER 1 > (handler-bind ((warning (lambda (c) (muffle-warning c)))) (warn "foo")) NIL
That's just great, thanks. :) .
- References:
- (warn) isn't doing what I expect it to
- From: Nathan Baum
- Re: (warn) isn't doing what I expect it to
- From: Wade Humeniuk
- (warn) isn't doing what I expect it to
- Prev by Date: Re: (warn) isn't doing what I expect it to
- Next by Date: Re: (warn) isn't doing what I expect it to
- Previous by thread: Re: (warn) isn't doing what I expect it to
- Next by thread: Re: (warn) isn't doing what I expect it to
- Index(es):
Relevant Pages
|