Skip to content
Snippets Groups Projects
Commit 61344b8e authored by ram's avatar ram
Browse files

Made SYMBOL-FUNCTION and SYMBOL-VALUE safe. Changed GENSYM to use

QUICK-INTEGER-TO-STRING.
parent ee635134
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/symbol.lisp,v 1.5 1991/02/08 13:36:05 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/symbol.lisp,v 1.6 1991/04/23 17:02:55 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -47,11 +47,13 @@ ...@@ -47,11 +47,13 @@
(defun symbol-value (variable) (defun symbol-value (variable)
"VARIABLE must evaluate to a symbol. This symbol's current special "VARIABLE must evaluate to a symbol. This symbol's current special
value is returned." value is returned."
(declare (optimize (safety 1)))
(symbol-value variable)) (symbol-value variable))
(defun symbol-function (variable) (defun symbol-function (variable)
"VARIABLE must evaluate to a symbol. This symbol's current definition "VARIABLE must evaluate to a symbol. This symbol's current definition
is returned." is returned."
(declare (optimize (safety 1)))
(symbol-function variable)) (symbol-function variable))
(defun %sp-set-definition (symbol new-value) (defun %sp-set-definition (symbol new-value)
...@@ -186,14 +188,11 @@ ...@@ -186,14 +188,11 @@
alter the prefix if it is a string, or the decimal number if it is a alter the prefix if it is a string, or the decimal number if it is a
number, of this symbol. The number, defaultly *gensym-counter*, is number, of this symbol. The number, defaultly *gensym-counter*, is
incremented by each call to GENSYM." incremented by each call to GENSYM."
(let* ((*print-base* 10) (make-symbol
(*print-radix* nil) (concatenate 'simple-string
(*print-pretty* nil) (if (stringp string) string "G")
(prefix (if (stringp string) string "G")) (quick-integer-to-string
(number (prin1-to-string (if (numberp string) (if (integerp string) string (incf *gensym-counter*))))))
string
(incf *gensym-counter*)))))
(make-symbol (concatenate 'simple-string prefix number))))
(defun gentemp (&optional (prefix t) (package *package*)) (defun gentemp (&optional (prefix t) (package *package*))
"Creates a new symbol interned in package Package with the given Prefix." "Creates a new symbol interned in package Package with the given Prefix."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment