Destructuring lambda lists incorrectly accept further keyword arguments after &allow-other-keys

Bug #707556 reported by Jean-Philippe Paradis on 2011-01-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Douglas Katzman

Bug Description

What I do:
(destructuring-bind (&key &allow-other-keys bogus-keyword-arg)
    '(:bogus-keyword-arg value)

What happens:
The behavior is the same as if &allow-other-keys was correctly specified after the keyword argument. This bug applies to other forms such as DEFMACRO because it's handled by the same code. Note however that DEFUN correctly signals an error (as pointed out by stassats).

What I expected to happen:
As shown in CLHS 3.4.5 (and elsewhere), &allow-other-keys signals the end of keyword arguments:
keyvars::= [&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter]])}* [&allow-other-keys]]

I'd therefore expect an error to be signaled here, with a message such as "Unexpected variable after &allow-other-keys".

Note that an error is already correctly signaled in a very similar situation:

(destructuring-bind (&rest test bogus) '(thing) (values test bogus))
error --> "illegal or ill-formed required argument after &REST argument in DESTRUCTURING-BIND"

SBCL version: 1.0.42
uname -a: Linux dynamorph 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686 GNU/Linux


Changed in sbcl:
importance: Undecided → Low
status: New → Triaged
Douglas Katzman (dougk) on 2015-06-11
Changed in sbcl:
assignee: nobody → Douglas Katzman (dougk)
Douglas Katzman (dougk) on 2015-07-02
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  Edit
Everyone can see this information.

Other bug subscribers