From c482b4547542853e71a3af2870c87ea366069913 Mon Sep 17 00:00:00 2001
From: David <davazp@debian>
Date: Fri, 21 Feb 2014 20:52:00 +0100
Subject: [PATCH] SETQ signals error if the first argument is not a symbol

---
 src/compiler/compiler.lisp |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/compiler/compiler.lisp b/src/compiler/compiler.lisp
index a19b51d..d5f0b55 100644
--- a/src/compiler/compiler.lisp
+++ b/src/compiler/compiler.lisp
@@ -440,12 +440,14 @@
 
 
 (defun setq-pair (var val)
+  (unless (symbolp var)
+    (error "~a is not a symbol" var))
   (let ((b (lookup-in-lexenv var *environment* 'variable)))
     (cond
       ((and b
-            (eq (binding-type b) 'variable)
-            (not (member 'special (binding-declarations b)))
-            (not (member 'constant (binding-declarations b))))
+	    (eq (binding-type b) 'variable)
+	    (not (member 'special (binding-declarations b)))
+	    (not (member 'constant (binding-declarations b))))
        `(= ,(binding-value b) ,(convert val)))
       ((and b (eq (binding-type b) 'macro))
        (convert `(setf ,var ,val)))
-- 
1.7.10.4