X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fsymbol.lisp;h=f2c1c0ccc13802a5dcb11653b6fbf4ca8df96e1a;hb=f4f18b9dcdaf1948947b1747f5bfa766a1a0ee4c;hp=3ceba16e130d3e0f85b88eb5d17b107fbdfbed81;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/code/symbol.lisp b/src/code/symbol.lisp index 3ceba16..f2c1c0c 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 @@ -150,9 +151,8 @@ (defun getf (place indicator &optional (default ())) #!+sb-doc - "Searches the property list stored in Place for an indicator EQ to Indicator. - If one is found, the corresponding value is returned, else the Default is - returned." + "Search the property list stored in Place for an indicator EQ to INDICATOR. + If one is found, return the corresponding value, else return DEFAULT." (do ((plist place (cddr plist))) ((null plist) default) (cond ((atom (cdr plist)) @@ -172,8 +172,8 @@ (defun get-properties (place indicator-list) #!+sb-doc - "Like GETF, except that Indicator-List is a list of indicators which will - be looked for in the property list stored in Place. Three values are + "Like GETF, except that INDICATOR-LIST is a list of indicators which will + be looked for in the property list stored in PLACE. Three values are returned, see manual for details." (do ((plist place (cddr plist))) ((null plist) (values nil nil nil)) @@ -200,6 +200,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 +245,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)