Re: (warn) isn't doing what I expect it to
- From: Harald Hanche-Olsen <hanche@xxxxxxxxxxxx>
- Date: 30 Aug 2005 00:25:16 +0200
+ Nathan Baum <nathan_baum@xxxxxxxxxxxxxx>:
| 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?
You are using HANDLER-CASE, which unwinds the stack, thereby
discarding the restart, before invoing the handler.
You need to use HANDLER-BIND instead:
(handler-bind
((warning #'muffle-warning))
(warn "foo"))
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
than thinking does: but it deprives us of whatever chance there is
of getting closer to the truth. -- C.P. Snow
.
- Follow-Ups:
- Re: (warn) isn't doing what I expect it to
- From: Harald Hanche-Olsen
- Re: (warn) isn't doing what I expect it to
- References:
- (warn) isn't doing what I expect it to
- From: Nathan Baum
- (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: (Prolog + LISP + Erlang) with integration issues versus C++
- 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
|