akovalenko/sbcl-win32-threads — Issue #18: HANDLER-CASE => TYPECASE should not happen the way it is done
Author: mgrmgr
Created: 2012-02-29 14:43:33+00:00
State: open

Hello,

I noticed that in on old code of mine a HANDLER-BIND gets translated to TYPECASE now on sbcl 1.0.55.3.mswinmt.1182-d7a1816, see lisp paste http://paste.lisp.org/display/128053

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 2389f00e518aa1775b08b3d586d5cfd9609d8f42 (https://github.com/akovalenko/sbcl-win32-threads/commit/2389f00e518aa1775b08b3d586d5cfd9609d8f42).

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

Bye Max