Skip to content

HANDLER-CASE => TYPECASE should not happen the way it is done #18

mgrmgr opened this Issue Feb 29, 2012 · 3 comments

2 participants

mgrmgr commented Feb 29, 2012


I noticed that in on old code of mine a HANDLER-BIND gets translated to TYPECASE now on sbcl, see lisp paste

But in a handler-bind (in contrast to a typecase) there can be multiple handlers for the same type (as a handler can decline handling the condition). That doesn't seem to happen anymore with this translation (I didn't get that warning some two or three years ago with an sbcl of that time, I guess. This translation does not happen on sbcl linux 1.0.6 and 1.0.55, as guys on #lisp mentioned.

The clhs mentiones that "the handler bindings are searched sequentially from top to bottom in search of a match (by visual analogy with typecase). [...] If the handler declines, the search continues for another handler." I think that this implies that a handler-bind should not get translated to a typecase in this way. Some other #lisp hackers agreed on that interpretation.

It is suggested that this was introduced in the windows port in commit 2389f00 (2389f00).

Thanks for your work, the windows port works really well.

Bye Max


Should be fixed by d20ec0c (and in binary build 1185 I've recently uploaded). Thanks for the heads up.

For your information: It was a bug introduced by my optimization of handler-bind, which purported to avoid non-static TYPEP. I misinterpreted the phrase in CLHS HANDLER-BIND, mentioning "visual analogy with typecase".

mgrmgr commented Mar 1, 2012


wow, that's a quick response and even a bug fix already. Thanks!
Even a new binary already? I'll test it tomorrow!

Bye Max (mgr)

mgrmgr commented Mar 1, 2012

Great, works again. Thank you!

Bye mgr

@mgrmgr mgrmgr closed this Mar 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.