Signal an error when `setf' gets an odd number of arguments.

* lisp/emacs-lisp/gv.el (setf): Amend.
This commit is contained in:
Alan Mackenzie 2015-11-23 17:13:55 +00:00
parent 9f1a5113e1
commit b6bc4ab20c

View 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)))