Subject: Re: handler-bind
From: Erik Naggum <erik@naggum.net>
Date: Sun, 13 May 2001 16:19:04 GMT
Newsgroups: comp.lang.lisp
Message-ID: <3198759540763430@naggum.net>

* Kent M Pitman
> Btw, LispWorks 4.1.20 disagrees with me, at least in implementation, not
> sure about intent.  It does:
> 
>  (handler-bind ((error #'(lambda (c) (break "Bar: ~A" c))))
>    (handler-bind ((error #'(lambda (c) nil))
>                   (error #'(lambda (c) (break "Foo: ~A" c))))
>      (error "Testing...")))
> 
>  Foo: Testing...
> 
> where I would have expected to break with "Bar: Testing...".

* "Pierre R. Mai" <pmai@acm.org>
> Both ACL and CMU CL seem to agree with LispWorks on that point, both
> first breaking into the Foo: Testing break-loop, instead of proceeding
> directly into the Bar: Testing break-loop...

  I remain uncertain what we are demonstrating here, but for what it might
  be worth, Allegro CL 6.0 breaks with "Bar: More Testing..." when running
  this snippet of code:

(handler-bind ((error #'(lambda (c) (break "Bar: ~A" c))))
  (handler-bind ((error #'(lambda (c) (error "More ~A" c)))
		 (error #'(lambda (c) (break "Foo: ~A" c))))
    (error "Testing...")))

  while breaking with "Foo: Testing..." in the example quoted above, which
  does indicate that the next handler is not visible while in the handler,
  but somehow reinstated when searching for an applicable handler, like
  cond instead of like typecase.

#:Erik
-- 
  Travel is a meat thing.