From 15db88b169f732c8d339047bfad92e0725d7cacc Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sat, 15 Oct 2005 10:31:38 +0000 Subject: [PATCH] 0.9.5.62: trivial PCL cleanups * it's PRINTED-AS-FUNCALLABLE-STANDARD-CLASS, not PRINTED-AS-CLOS-FUNCALLABLE-STANDARD-CLASS. * PARSE-FSPEC is a no-op -- kill it. * GBOUNDP and GMAKUNBOUND are null and useless wrappers -- kill them. Keep GDEFINITION and (SETF GDEFINITION) as they may become useful when FDEFINITION stops bypassing fwrappers/encapsulations. --- src/code/print.lisp | 2 +- src/pcl/boot.lisp | 10 +++++----- src/pcl/defs.lisp | 50 +++++++++--------------------------------------- src/pcl/std-class.lisp | 2 +- version.lisp-expr | 2 +- 5 files changed, 17 insertions(+), 49 deletions(-) diff --git a/src/code/print.lisp b/src/code/print.lisp index 9da5da1..aa060d6 100644 --- a/src/code/print.lisp +++ b/src/code/print.lisp @@ -1517,7 +1517,7 @@ ;;; The definition here is a simple temporary placeholder. It will be ;;; overwritten by a smarter version (capable of calling generic ;;; PRINT-OBJECT when appropriate) when CLOS is installed. -(defun printed-as-clos-funcallable-standard-class (object stream) +(defun printed-as-funcallable-standard-class (object stream) (declare (ignore object stream)) nil) diff --git a/src/pcl/boot.lisp b/src/pcl/boot.lisp index aee604a..6ec7f1a 100644 --- a/src/pcl/boot.lisp +++ b/src/pcl/boot.lisp @@ -313,7 +313,7 @@ bootstrapping. (defun prototypes-for-make-method-lambda (name) (if (not (eq *boot-state* 'complete)) (values nil nil) - (let ((gf? (and (gboundp name) + (let ((gf? (and (fboundp name) (gdefinition name)))) (if (or (null gf?) (not (generic-function-p gf?))) @@ -335,7 +335,7 @@ bootstrapping. ;;; ;;; Note: During bootstrapping, this function is allowed to return NIL. (defun method-prototype-for-gf (name) - (let ((gf? (and (gboundp name) + (let ((gf? (and (fboundp name) (gdefinition name)))) (cond ((neq *boot-state* 'complete) nil) ((or (null gf?) @@ -1359,7 +1359,7 @@ bootstrapping. (defun generic-function-name-p (name) (and (legal-fun-name-p name) - (gboundp name) + (fboundp name) (if (eq *boot-state* 'complete) (standard-generic-function-p (gdefinition name)) (funcallable-instance-p (gdefinition name))))) @@ -1594,7 +1594,7 @@ bootstrapping. &key environment &allow-other-keys) (declare (ignore environment)) - (let ((existing (and (gboundp fun-name) + (let ((existing (and (fboundp fun-name) (gdefinition fun-name)))) (if (and existing (eq *boot-state* 'complete) @@ -2344,7 +2344,7 @@ bootstrapping. (make-symbol (format nil "~S" method)))) (multiple-value-bind (gf-spec quals specls) (parse-defmethod spec) - (and (setq gf (and (or errorp (gboundp gf-spec)) + (and (setq gf (and (or errorp (fboundp gf-spec)) (gdefinition gf-spec))) (let ((nreq (compute-discriminating-function-arglist-info gf))) (setq specls (append (parse-specializers specls) diff --git a/src/pcl/defs.lisp b/src/pcl/defs.lisp index 781f4c6..e2240a1 100644 --- a/src/pcl/defs.lisp +++ b/src/pcl/defs.lisp @@ -38,50 +38,18 @@ has already been partially loaded. This may not work, you may~%~ need to get a fresh lisp (reboot) and then load PCL.")) -;;; comments from CMU CL version of PCL: -;;; This is like fdefinition on the Lispm. If Common Lisp had -;;; something like function specs I wouldn't need this. On the other -;;; hand, I don't like the way this really works so maybe function -;;; specs aren't really right either? -;;; I also don't understand the real implications of a Lisp-1 on this -;;; sort of thing. Certainly some of the lossage in all of this is -;;; because these SPECs name global definitions. -;;; Note that this implementation is set up so that an implementation -;;; which has a 'real' function spec mechanism can use that instead -;;; and in that way get rid of setf generic function names. -(defmacro parse-gspec (spec - (non-setf-var . non-setf-case)) - `(let ((,non-setf-var ,spec)) ,@non-setf-case)) - -;;; If symbol names a function which is traced, return the untraced -;;; definition. This lets us get at the generic function object even -;;; when it is traced. -(defun unencapsulated-fdefinition (symbol) - (fdefinition symbol)) - -;;; If symbol names a function which is traced, redefine the `real' -;;; definition without affecting the trace. -(defun fdefine-carefully (name new-definition) - (progn - (sb-c::note-name-defined name :function) - new-definition) - (setf (fdefinition name) new-definition)) - -(defun gboundp (spec) - (parse-gspec spec - (name (fboundp name)))) - -(defun gmakunbound (spec) - (parse-gspec spec - (name (fmakunbound name)))) - +#-sb-fluid (declaim (inline gdefinition)) (defun gdefinition (spec) - (parse-gspec spec - (name (unencapsulated-fdefinition name)))) + ;; This is null layer right now, but once FDEFINITION stops bypasssing + ;; fwrappers/encapsulations we can do that here. + (fdefinition spec)) (defun (setf gdefinition) (new-value spec) - (parse-gspec spec - (name (fdefine-carefully name new-value)))) + ;; This is almost a null layer right now, but once (SETF + ;; FDEFINITION) stops bypasssing fwrappers/encapsulations we can do + ;; that here. + (sb-c::note-name-defined spec :function) ; FIXME: do we need this? Why? + (setf (fdefinition spec) new-value)) ;;;; type specifier hackery diff --git a/src/pcl/std-class.lisp b/src/pcl/std-class.lisp index fc53ebd..19377bb 100644 --- a/src/pcl/std-class.lisp +++ b/src/pcl/std-class.lisp @@ -693,7 +693,7 @@ (unless (structure-type-p name) (eval defstruct-form)) (mapc (lambda (dslotd reader-name writer-name) (let* ((reader (gdefinition reader-name)) - (writer (when (gboundp writer-name) + (writer (when (fboundp writer-name) (gdefinition writer-name)))) (setf (slot-value dslotd 'internal-reader-function) reader) diff --git a/version.lisp-expr b/version.lisp-expr index 83c7b68..44816c5 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.5.61" +"0.9.5.62" -- 1.7.10.4