X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=symbols.lisp;h=d14f4f28bfc1e6a03e6efece890489a4e339869b;hp=870426e3e426169733930484047e168791a43908;hb=03712fbb06acbb103602bae10f41aeae7fa05127;hpb=739b14ee8844dc777b174105646df3abcb865282 diff --git a/symbols.lisp b/symbols.lisp index 870426e..d14f4f2 100644 --- a/symbols.lisp +++ b/symbols.lisp @@ -25,22 +25,22 @@ (let ((vars '())) (do-symbols (s 'common-lisp) (multiple-value-bind (sym status) - (find-symbol (symbol-name s) 'common-lisp) - (when (and (or (eq status :external) - (eq status :internal)) - (boundp sym)) - (push sym vars)))) + (find-symbol (symbol-name s) 'common-lisp) + (when (and (or (eq status :external) + (eq status :internal)) + (boundp sym)) + (push sym vars)))) (nreverse vars))) (defun cl-functions () (let ((funcs '())) (do-symbols (s 'common-lisp) (multiple-value-bind (sym status) - (find-symbol (symbol-name s) 'common-lisp) - (when (and (or (eq status :external) - (eq status :internal)) - (fboundp sym)) - (push sym funcs)))) + (find-symbol (symbol-name s) 'common-lisp) + (when (and (or (eq status :external) + (eq status :internal)) + (fboundp sym)) + (push sym funcs)))) (nreverse funcs))) ;;; Symbol functions @@ -49,7 +49,7 @@ (when (char= #\a (schar (symbol-name '#:a) 0)) (pushnew :kmrcl-lowercase-reader *features*)) (when (not (string= (symbol-name '#:a) - (symbol-name '#:A))) + (symbol-name '#:A))) (pushnew :kmrcl-case-sensitive *features*))) (defun string-default-case (str) @@ -70,7 +70,7 @@ (symbol-name arg))))) (let ((str (apply #'concatenate 'string (mapcar #'stringify args)))) (nth-value 0 (intern (string-default-case str) - (if pkg pkg *package*)))))) + (if pkg pkg *package*)))))) (defun concat-symbol (&rest args) @@ -85,11 +85,11 @@ (defun ensure-keyword-upcase (desig) (nth-value 0 (intern (string-upcase - (symbol-name (ensure-keyword desig))) :keyword))) + (symbol-name (ensure-keyword desig))) :keyword))) (defun ensure-keyword-default-case (desig) (nth-value 0 (intern (string-default-case - (symbol-name (ensure-keyword desig))) :keyword))) + (symbol-name (ensure-keyword desig))) :keyword))) (defun show (&optional (what :variables) (package *package*)) (ecase what @@ -99,46 +99,46 @@ (defun show-variables (package) (do-symbols (s package) (multiple-value-bind (sym status) - (find-symbol (symbol-name s) package) + (find-symbol (symbol-name s) package) (when (and (or (eq status :external) - (eq status :internal)) - (boundp sym)) - (format t "~&Symbol ~S~T -> ~S~%" - sym - (symbol-value sym)))))) + (eq status :internal)) + (boundp sym)) + (format t "~&Symbol ~S~T -> ~S~%" + sym + (symbol-value sym)))))) (defun show-functions (package) (do-symbols (s package) (multiple-value-bind (sym status) - (find-symbol (symbol-name s) package) + (find-symbol (symbol-name s) package) (when (and (or (eq status :external) - (eq status :internal)) - (fboundp sym)) - (format t "~&Function ~S~T -> ~S~%" - sym - (symbol-function sym)))))) + (eq status :internal)) + (fboundp sym)) + (format t "~&Function ~S~T -> ~S~%" + sym + (symbol-function sym)))))) (defun find-test-generic-functions (instance) "Return a list of symbols for generic functions specialized on the class of an instance and whose name begins with the string 'test-'" (let ((res) - (package (symbol-package (class-name (class-of instance))))) + (package (symbol-package (class-name (class-of instance))))) (do-symbols (s package) (multiple-value-bind (sym status) - (find-symbol (symbol-name s) package) - (when (and (or (eq status :external) - (eq status :internal)) - (fboundp sym) - (eq (symbol-package sym) package) - (> (length (symbol-name sym)) 5) - (string-equal "test-" (subseq (symbol-name sym) 0 5)) - (typep (symbol-function sym) 'generic-function) - (plusp - (length - (compute-applicable-methods - (ensure-generic-function sym) - (list instance))))) - (push sym res)))) + (find-symbol (symbol-name s) package) + (when (and (or (eq status :external) + (eq status :internal)) + (fboundp sym) + (eq (symbol-package sym) package) + (> (length (symbol-name sym)) 5) + (string-equal "test-" (subseq (symbol-name sym) 0 5)) + (typep (symbol-function sym) 'generic-function) + (plusp + (length + (compute-applicable-methods + (ensure-generic-function sym) + (list instance))))) + (push sym res)))) (nreverse res))) (defun run-tests-for-instance (instance)