mdw-base.lisp: Export symbols near their definitions.
[lisp] / mdw-mop.lisp
index e813f97..e744fcd 100644 (file)
     (Yes, I know that using functions would be nicer, but the MOP makes
     that surprisingly difficult.)"))
 
+(defgeneric slot-definition-filter (slot)
+  (:method ((slot slot-definition)) nil))
+
 (defclass filtered-direct-slot-definition
     (standard-direct-slot-definition)
   ((filter :initarg :filter :reader slot-definition-filter)))
 
-(defgeneric slot-definition-filter (slot)
-  (:method ((slot slot-definition)) nil))
-
 (defclass filtered-effective-slot-definition
     (standard-effective-slot-definition)
   ((filter :initarg :filter :accessor slot-definition-filter)))
 (defun print-object-with-slots (obj stream)
   "Prints objects in a pleasant way.  Not too clever about circularity."
   (let ((class (class-of obj))
-        (magic (cons 'magic nil)))
+       (magic (cons 'magic nil)))
     (print-unreadable-object (obj stream)
       (pprint-logical-block
-          (stream
-           (mapcan (lambda (slot)
-                     (list (or (car (slot-definition-initargs slot))
-                               (slot-definition-name slot))
-                           (if (slot-boundp-using-class class obj slot)
-                               (slot-value-using-class class obj slot)
-                               magic)))
-                   (class-slots class)))
-        (format stream "~S" (class-name class))
-        (let ((sep nil))
-          (loop
-            (pprint-exit-if-list-exhausted)
-            (if sep
-                (format stream " ~_")
-                (progn (format stream " ~@_~:I") (setf sep t)))
-            (let ((name (pprint-pop))
-                  (value (pprint-pop)))
-              (format stream "~S ~@_~:[~W~;#<unbound>~*~]"
-                      name (eq value magic) value))))))))
+         (stream
+          (mapcan (lambda (slot)
+                    (list (or (car (slot-definition-initargs slot))
+                              (slot-definition-name slot))
+                          (if (slot-boundp-using-class class obj slot)
+                              (slot-value-using-class class obj slot)
+                              magic)))
+                  (class-slots class)))
+       (format stream "~S" (class-name class))
+       (let ((sep nil))
+         (loop
+           (pprint-exit-if-list-exhausted)
+           (if sep
+               (format stream " ~_")
+               (progn (format stream " ~@_~:I") (setf sep t)))
+           (let ((name (pprint-pop))
+                 (value (pprint-pop)))
+             (format stream "~S ~@_~:[~W~;#<unbound>~*~]"
+                     name (eq value magic) value))))))))
 
 ;;;----- That's all, folks --------------------------------------------------