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

Bug #707556 reported by Jean-Philippe Paradis
6
This bug affects 1 person
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-keyword-arg value)
  bogus-keyword-arg)

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

*features*:
(:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF2 :ASDF :ANSI-CL :COMMON-LISP
 :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL
 :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86 :UNIX :ELF :LINUX :SB-THREAD
 :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK
 :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP :RAW-INSTANCE-INIT-VOPS
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-BARRIER-VOPS :LINKAGE-TABLE
 :OS-PROVIDES-DLOPEN :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T)

Changed in sbcl:
importance: Undecided → Low
status: New → Triaged
Douglas Katzman (dougk)
Changed in sbcl:
assignee: nobody → Douglas Katzman (dougk)
Douglas Katzman (dougk)
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.