X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fsymbol.lisp;h=600c6ce661641da54bd3c532c2be1711e1cd4287;hb=a4d2556c02207a7b04ec497155f52e4f21d2795c;hp=3ceba16e130d3e0f85b88eb5d17b107fbdfbed81;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/code/symbol.lisp b/src/code/symbol.lisp index 3ceba16..600c6ce 100644 --- a/src/code/symbol.lisp +++ b/src/code/symbol.lisp @@ -35,15 +35,8 @@ "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)) @@ -56,11 +49,19 @@ (%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 @@ -200,6 +201,7 @@ (setf (symbol-function new-symbol) (symbol-function symbol)))) new-symbol) +;;; FIXME: This declaration should be redundant. (declaim (special *keyword-package*)) (defun keywordp (object) @@ -244,9 +246,9 @@ (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)