extern double atof ();
#endif /* !atof */
+/* Nonzero means it is an error to set a symbol whose name starts with
+ colon. */
+int keyword_symbols_constant_flag;
+
Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range;
register Lisp_Object symbol;
{
CHECK_SYMBOL (symbol, 0);
- if (NILP (symbol) || EQ (symbol, Qt))
+ if (NILP (symbol) || EQ (symbol, Qt)
+ || (XSYMBOL (symbol)->name->data[0] == ':'
+ && keyword_symbols_constant_flag))
return Fsignal (Qsetting_constant, Fcons (symbol, Qnil));
Fset (symbol, Qunbound);
return symbol;
register Lisp_Object valcontents, tem1, current_alist_element;
CHECK_SYMBOL (symbol, 0);
- if (NILP (symbol) || EQ (symbol, Qt))
+ if (NILP (symbol) || EQ (symbol, Qt)
+ || (XSYMBOL (symbol)->name->data[0] == ':'
+ && keyword_symbols_constant_flag))
return Fsignal (Qsetting_constant, Fcons (symbol, Qnil));
valcontents = XSYMBOL (symbol)->value;
staticpro (&Qchar_table);
staticpro (&Qbool_vector);
+ DEFVAR_BOOL ("keyword-symbols-constant-flag", &keyword_symbols_constant_flag,
+ "Non-nil means it is an error to set a keyword symbol.\n\
+A keyword symbol is a symbol whose name starts with a colon (`:').");
+ keyword_symbols_constant_flag = 1;
+
defsubr (&Seq);
defsubr (&Snull);
defsubr (&Stype_of);