projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
1.0.48.17: hopefully fix build on win32
[sbcl.git]
/
src
/
pcl
/
defclass.lisp
diff --git
a/src/pcl/defclass.lisp
b/src/pcl/defclass.lisp
index
831dcdd
..
cd9bd18
100644
(file)
--- a/
src/pcl/defclass.lisp
+++ b/
src/pcl/defclass.lisp
@@
-53,7
+53,7
@@
;; DEFSTRUCT-P should be true if the class is defined
;; with a metaclass STRUCTURE-CLASS, so that a DEFSTRUCT
;; is compiled for the class.
;; DEFSTRUCT-P should be true if the class is defined
;; with a metaclass STRUCTURE-CLASS, so that a DEFSTRUCT
;; is compiled for the class.
- (defstruct-p (and (eq *boot-state* 'complete)
+ (defstruct-p (and (eq **boot-state** 'complete)
(let ((mclass (find-class metaclass nil)))
(and mclass
(*subtypep
(let ((mclass (find-class metaclass nil)))
(and mclass
(*subtypep
@@
-72,7
+72,8
@@
',*readers-for-this-defclass*
',*writers-for-this-defclass*
',*slot-names-for-this-defclass*
',*readers-for-this-defclass*
',*writers-for-this-defclass*
',*slot-names-for-this-defclass*
- (sb-c:source-location)))))
+ (sb-c:source-location)
+ ',(safe-code-p env)))))
(if defstruct-p
(progn
;; FIXME: (YUK!) Why do we do this? Because in order
(if defstruct-p
(progn
;; FIXME: (YUK!) Why do we do this? Because in order
@@
-120,7
+121,7
@@
(defun canonize-defclass-options (class-name options)
(maplist (lambda (sublist)
(let ((option-name (first (pop sublist))))
(defun canonize-defclass-options (class-name options)
(maplist (lambda (sublist)
(let ((option-name (first (pop sublist))))
- (when (member option-name sublist :key #'first)
+ (when (member option-name sublist :key #'first :test #'eq)
(error 'simple-program-error
:format-control "Multiple ~S options in DEFCLASS ~S."
:format-arguments (list option-name class-name)))))
(error 'simple-program-error
:format-control "Multiple ~S options in DEFCLASS ~S."
:format-arguments (list option-name class-name)))))
@@
-144,7
+145,7
@@
(:default-initargs
(let (initargs arg-names)
(doplist (key val) (cdr option)
(:default-initargs
(let (initargs arg-names)
(doplist (key val) (cdr option)
- (when (member key arg-names)
+ (when (member key arg-names :test #'eq)
(error 'simple-program-error
:format-control "~@<Duplicate initialization argument ~
name ~S in :DEFAULT-INITARGS of ~
(error 'simple-program-error
:format-control "~@<Duplicate initialization argument ~
name ~S in :DEFAULT-INITARGS of ~
@@
-162,6
+163,8
@@
(push `(:documentation ,(second option)) canonized-options))
(otherwise
(push `(',(car option) ',(cdr option)) canonized-options))))
(push `(:documentation ,(second option)) canonized-options))
(otherwise
(push `(',(car option) ',(cdr option)) canonized-options))))
+ (unless default-initargs
+ (push '(:direct-default-initargs nil) canonized-options))
(values (or metaclass 'standard-class) (nreverse canonized-options))))
(defun canonize-defclass-slots (class-name slots env)
(values (or metaclass 'standard-class) (nreverse canonized-options))))
(defun canonize-defclass-slots (class-name slots env)
@@
-183,6
+186,7
@@
(initargs ())
(others ())
(unsupplied (list nil))
(initargs ())
(others ())
(unsupplied (list nil))
+ (type t)
(initform unsupplied))
(check-slot-name-for-defclass name class-name env)
(push name *slot-names-for-this-defclass*)
(initform unsupplied))
(check-slot-name-for-defclass name class-name env)
(push name *slot-names-for-this-defclass*)
@@
-213,6
+217,8
@@
(when (member key '(:initform :allocation :type :documentation))
(when (eq key :initform)
(setf initform val))
(when (member key '(:initform :allocation :type :documentation))
(when (eq key :initform)
(setf initform val))
+ (when (eq key :type)
+ (setf type val))
(when (get-properties others (list key))
(error 'simple-program-error
:format-control "Duplicate slot option ~S for slot ~
(when (get-properties others (list key))
(error 'simple-program-error
:format-control "Duplicate slot option ~S for slot ~
@@
-248,7
+254,7
@@
(slot-name-illegal "a keyword"))
((constantp name env)
(slot-name-illegal "a constant"))
(slot-name-illegal "a keyword"))
((constantp name env)
(slot-name-illegal "a constant"))
- ((member name *slot-names-for-this-defclass*)
+ ((member name *slot-names-for-this-defclass* :test #'eq)
(error 'simple-program-error
:format-control "Multiple slots named ~S in DEFCLASS ~S."
:format-arguments (list name class-name))))))
(error 'simple-program-error
:format-control "Multiple slots named ~S in DEFCLASS ~S."
:format-arguments (list name class-name))))))
@@
-269,7
+275,10
@@
(unless entry
(setq entry (list initform
(gensym)
(unless entry
(setq entry (list initform
(gensym)
- `(function (lambda () ,initform))))
+ `(function (lambda ()
+ (declare (optimize
+ (sb-c:store-coverage-data 0)))
+ ,initform))))
(push entry *initfunctions-for-this-defclass*))
(cadr entry)))))
(push entry *initfunctions-for-this-defclass*))
(cadr entry)))))
@@
-452,6
+461,9
@@
(defun early-slot-definition-location (slotd)
(!bootstrap-get-slot 'standard-effective-slot-definition slotd 'location))
(defun early-slot-definition-location (slotd)
(!bootstrap-get-slot 'standard-effective-slot-definition slotd 'location))
+(defun early-slot-definition-info (slotd)
+ (!bootstrap-get-slot 'standard-effective-slot-definition slotd 'info))
+
(defun early-accessor-method-slot-name (method)
(!bootstrap-get-slot 'standard-accessor-method method 'slot-name))
(defun early-accessor-method-slot-name (method)
(!bootstrap-get-slot 'standard-accessor-method method 'slot-name))
@@
-465,20
+477,23
@@
(declaim (notinline load-defclass))
(defun load-defclass (name metaclass supers canonical-slots canonical-options
(declaim (notinline load-defclass))
(defun load-defclass (name metaclass supers canonical-slots canonical-options
- readers writers slot-names source-location)
+ readers writers slot-names source-location safe-p)
+ ;; SAFE-P is used by REAL-LOAD-DEFCLASS, but can be ignored here, since
+ ;; during the bootstrap we won't have (SAFETY 3).
+ (declare (ignore safe-p))
(%compiler-defclass name readers writers slot-names)
(setq supers (copy-tree supers)
canonical-slots (copy-tree canonical-slots)
canonical-options (copy-tree canonical-options))
(let ((ecd
(%compiler-defclass name readers writers slot-names)
(setq supers (copy-tree supers)
canonical-slots (copy-tree canonical-slots)
canonical-options (copy-tree canonical-options))
(let ((ecd
- (make-early-class-definition name
- source-location
- metaclass
- supers
- canonical-slots
- canonical-options))
+ (make-early-class-definition name
+ source-location
+ metaclass
+ supers
+ canonical-slots
+ canonical-options))
(existing
(existing
- (find name *early-class-definitions* :key #'ecd-class-name)))
+ (find name *early-class-definitions* :key #'ecd-class-name)))
(setq *early-class-definitions*
(cons ecd (remove existing *early-class-definitions*)))
ecd))
(setq *early-class-definitions*
(cons ecd (remove existing *early-class-definitions*)))
ecd))