Signal an error when `setf' gets an odd number of arguments.
authorAlan Mackenzie <acm@muc.de>
Mon, 23 Nov 2015 17:13:55 +0000 (17:13 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 23 Nov 2015 17:13:55 +0000 (17:13 +0000)
* lisp/emacs-lisp/gv.el (setf): Amend.

lisp/emacs-lisp/gv.el

index 9e00190e000458bae54a07a07acd8387f39a00fd..1fea38c49c1b544f5216204de55ad014130bf4fd 100644 (file)
@@ -260,6 +260,8 @@ The return value is the last VAL in the list.
 
 \(fn PLACE VAL PLACE VAL ...)"
   (declare (debug (&rest [gv-place form])))
+  (if (/= (logand (length args) 1) 0)
+      (signal 'wrong-number-of-arguments (list 'setf (length args))))
   (if (and args (null (cddr args)))
       (let ((place (pop args))
             (val (car args)))