Destructuring lambda lists incorrectly accept further keyword arguments after &allow-other-keys
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Douglas Katzman |
Bug Description
What I do:
(destructuring-bind (&key &allow-other-keys bogus-keyword-arg)
'(:
bogus-
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-
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
*features*:
(:SWANK :QUICKLISP :SB-BSD-
:SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL
:SB-SOURCE-
:LARGEFILE :GENCGC :STACK-
:COMPARE-
:STACK-
:STACK-
:CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-
:OS-PROVIDES-
Changed in sbcl: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in sbcl: | |
assignee: | nobody → Douglas Katzman (dougk) |
Changed in sbcl: | |
status: | Triaged → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |