changeset 64185:c6d6fa805aad

(Fdefvar): Allow defvaring a constant to itself quoted.
author Richard M. Stallman <rms@gnu.org>
date Sat, 09 Jul 2005 03:42:43 +0000
parents a0570a2818b2
children d14a59c4f989
files src/eval.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Sat Jul 09 03:41:40 2005 +0000
+++ b/src/eval.c	Sat Jul 09 03:42:43 2005 +0000
@@ -807,8 +807,16 @@
 
   sym = Fcar (args);
   if (SYMBOL_CONSTANT_P (sym))
-    error ("Constant symbol `%s' specified in defvar",
-           SDATA (SYMBOL_NAME (sym)));
+    {
+      /* For updward compatibility, allow (defvar :foo (quote :foo)).  */
+      tem = Fcar (Fcdr (args));
+      if (! (CONSP (tem)
+	     && EQ (XCAR (tem), Qquote)
+	     && CONSP (XCDR (tem))
+	     && EQ (XCAR (XCDR (tem)), sym)))
+	error ("Constant symbol `%s' specified in defvar",
+	       SDATA (SYMBOL_NAME (sym)));
+    }
 
   tail = Fcdr (args);
   if (!NILP (Fcdr (Fcdr (tail))))