RESTART-BIND is not supposed to accept declarations

Bug #1876303 reported by Michał "phoe" Herda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

http://clhs.lisp.se/Body/s_declar.htm states:

> A declare expression, sometimes called a declaration, can occur only at the beginning of the bodies of certain forms (...)

It then proceeds to list forms that allow declarations; RESTART-BIND is not on that list. This is consistent with http://www.lispworks.com/documentation/HyperSpec/Body/m_rst_bi.htm which lists FORMS as an implicit progn, which does not accept declarations.

However, in SBCL, (restart-bind () (declare (optimize)) 42) does not signal an error.

The solution is to replace ,@forms with (progn ,@forms) in the macroexpansion or RESTART-BIND.

Stas Boukarev (stassats)
Changed in sbcl:
status: New → Triaged
Stas Boukarev (stassats)
Changed in sbcl:
status: Triaged → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.