STRUCTURE-CLASS).
** SLOT-EXISTS-P now works on conditions, as well as structures
and CLOS instances.
+ ** MAKE-LOAD-FORM now has the required methods on
+ STRUCTURE-OBJECT, CONDITION and STANDARD-OBJECT.
+ ** MAKE-LOAD-FORM-SAVING-SLOTS no longer returns a special
+ keyword, and now implements the SLOT-NAMES argument.
planned incompatible changes in 0.8.x:
* (not done yet, but planned:) When the profiling interface settles
;;; objects
(defun just-dump-it-normally (object &optional (env nil env-p))
(declare (type structure!object object))
+ (declare (ignorable env env-p))
+ ;; KLUDGE: we require essentially three different behaviours of
+ ;; JUST-DUMP-IT-NORMALLY, two of which (host compiler's
+ ;; MAKE-LOAD-FORM, cross-compiler's MAKE-LOAD-FORM) are handled by
+ ;; the #+SB-XC-HOST clause. The #-SB-XC-HOST clause is the
+ ;; behaviour required by the target, before the CLOS-based
+ ;; MAKE-LOAD-FORM-SAVING-SLOTS is implemented.
+ #+sb-xc-host
(if env-p
(sb!xc:make-load-form-saving-slots object :environment env)
- (sb!xc:make-load-form-saving-slots object)))
+ (sb!xc:make-load-form-saving-slots object))
+ #-sb-xc-host
+ :sb-just-dump-it-normally)
;;; a MAKE-LOAD-FORM function for objects which don't use the load
;;; form system. This is used for LAYOUT objects because the special
res))
\f
-;;; default PRINT-OBJECT and MAKE-LOAD-FORM methods
+;;; default PRINT-OBJECT method
(defun %default-structure-pretty-print (structure stream)
(let* ((layout (%instance-layout structure))
(%default-structure-ugly-print structure stream))))
(def!method print-object ((x structure-object) stream)
(default-structure-print x stream *current-level-in-print*))
-
-(defun make-load-form-saving-slots (object &key slot-names environment)
- (declare (ignore object environment))
- (if slot-names
- (error "stub: MAKE-LOAD-FORM-SAVING-SLOTS :SLOT-NAMES not implemented") ; KLUDGE
- :sb-just-dump-it-normally))
\f
;;;; testing structure types
(layout-classoid object)))
`(classoid-layout (find-classoid ',pname))))
+(defmethod make-load-form ((object structure-object) &optional env)
+ (declare (ignore env))
+ (error "~@<don't know how to dump ~S (default ~S method called).~@>"
+ object 'make-load-form))
+
+(defmethod make-load-form ((object standard-object) &optional env)
+ (declare (ignore env))
+ (error "~@<don't know how to dump ~S (default ~S method called).~@>"
+ object 'make-load-form))
+
+(defmethod make-load-form ((object condition) &optional env)
+ (declare (ignore env))
+ (error "~@<don't know how to dump ~S (default ~S method called).~@>"
+ object 'make-load-form))
+
+(defun make-load-form-saving-slots (object &key slot-names environment)
+ (declare (ignore environment))
+ (let ((class (class-of object)))
+ (collect ((inits))
+ (dolist (slot (class-slots class))
+ (let ((slot-name (slot-definition-name slot)))
+ (when (or (memq slot-name slot-names)
+ (and (null slot-names)
+ (eq :instance (slot-definition-allocation slot))))
+ (if (slot-boundp-using-class class object slot)
+ (let ((value (slot-value-using-class class object slot)))
+ (inits `(setf (slot-value ,object ',slot-name) ',value)))
+ (inits `(slot-makunbound ,object ',slot-name))))))
+ (values `(allocate-instance (find-class ',(class-name class)))
+ `(progn ,@(inits))))))
(find-class 'simple-condition))
(mapcar #'find-class '(simple-condition
condition
+ sb-pcl::slot-object
sb-kernel:instance
t))))
;;; 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.8alpha.0.36"
+"0.8alpha.0.37"