"VARIABLE must evaluate to a symbol. This symbol's special value cell is
set to the specified new value."
(declare (type symbol variable))
- (cond ((null variable)
- (error "Nihil ex nihil, NIL can't be set."))
- ((eq variable t)
- (error "Veritas aeterna, T can't be set."))
- ((and (boundp '*keyword-package*)
- (keywordp variable))
- (error "Keywords can't be set."))
- (t
- (%set-symbol-value variable new-value))))
+ (about-to-modify variable)
+ (%set-symbol-value variable new-value))
(defun %set-symbol-value (symbol new-value)
(%set-symbol-value symbol new-value))
(%primitive sb!c:make-other-immediate-type 0 sb!vm:unbound-marker-type))
variable)
+#!+(or x86 mips) ;; only backends for which a symbol-hash vop exists
(defun symbol-hash (symbol)
#!+sb-doc
"Return the built-in hash value for symbol."
(symbol-hash symbol))
+#!-(or x86 mips)
+(defun symbol-hash (symbol)
+ #!+sb-doc
+ "Return the built-in hash value for symbol."
+ (%sxhash-simple-string (symbol-name symbol)))
+
+
(defun symbol-function (variable)
#!+sb-doc
"VARIABLE must evaluate to a symbol. This symbol's current definition
(setf (symbol-function new-symbol) (symbol-function symbol))))
new-symbol)
+;;; FIXME: This declaration should be redundant.
(declaim (special *keyword-package*))
(defun keywordp (object)
(defvar *gentemp-counter* 0)
(declaim (type unsigned-byte *gentemp-counter*))
-(defun gentemp (&optional (prefix "T") (package *package*))
+(defun gentemp (&optional (prefix "T") (package (sane-package)))
#!+sb-doc
- "Creates a new symbol interned in package Package with the given Prefix."
+ "Creates a new symbol interned in package PACKAGE with the given PREFIX."
(declare (type string prefix))
(loop
(let ((*print-base* 10)