On 2022-10-28 11:58, Marc Nieper-Wißkirchen wrote:

IMO, it is actually a good thing for the name to be quite different
from Scheme's dynamic-wind.  Dynamic-wind is built so that control can
leave and enter the THUNK several times and has the notion of a
BEFORE-THUNK.  The first is forbidden and the latter is not the case
for unwind-protect.  Moreover, unwind-protect is syntax, while
dynamic-wind-once would probably be expected to be a procedure as
well.

What do you think?

Well, we have a procedure and a special form that do essentially similar things, namely ensuring that some cleanup code is executed when the protected form is exited, and yet one's name includes “wind” and the other's includes “unwind”. At the risk of saying something flammable/inflammable, this seems needlessly confusing. Perhaps `dynamic-wind' should have been called something else (though there were good reasons for choosing that name), but that ship has sailed.

Could this new form be called `wind-protect'?

I also think it's necessary to have an explanation about the differences between dynamic-wind and this new form. It's not obvious to me that a (human) reader would grasp the need for both without a few sentences explaining the intended uses.

-- vincent

Reply via email to