chiark / gitweb /
src/classes.lisp, src/class-finalize-impl.lisp: Don't export slot writers.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Sep 2015 10:27:11 +0000 (11:27 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 22 Sep 2015 10:27:38 +0000 (11:27 +0100)
Make accessors to finalization-time slots be plain readers, and use
`slot-value' explicitly to set them at the right time.

src/class-finalize-impl.lisp
src/classes.lisp

index b0e31ce1c8eabbdac55c5a16b0b9b9a43ca7a6fb..6bbc4f136cd75f8571dd92587ebf0f30cd9e385e 100644 (file)
@@ -350,7 +350,7 @@ (defmethod finalize-sod-class ((class sod-class))
       ((nil)
 
        ;; If this fails, mark the class as a loss.
-       (setf (sod-class-state class) :broken)
+       (setf (slot-value class 'state) :broken)
 
        ;; Finalize all of the superclasses.  There's some special pleading
        ;; here to make bootstrapping work: we don't try to finalize the
@@ -366,7 +366,7 @@ (defmethod finalize-sod-class ((class sod-class))
           (finalize-sod-class metaclass)))
 
        ;; Stash the class's type.
-       (setf (sod-class-type class)
+       (setf (slot-value class '%type)
             (make-class-type (sod-class-name class)))
 
        ;; Clobber the lists of items if they've not been set.
@@ -388,7 +388,7 @@ (defmethod finalize-sod-class ((class sod-class))
         (setf (values chain-head chain chains) (compute-chains class)))
 
        ;; Done.
-       (setf (sod-class-state class) :finalized)
+       (setf (slot-value class 'state) :finalized)
        t)
 
       (:broken
index afbb485cb8c75891b498a1e65ce2ab26102b6323..31878379d3b4188bc11c6295b1ff3a14abc679c9 100644 (file)
@@ -76,20 +76,20 @@ (defclass sod-class ()
    (methods :initarg :methods :initform nil
            :type list :accessor sod-class-methods)
 
-   (class-precedence-list :type list :accessor sod-class-precedence-list)
+   (class-precedence-list :type list :reader sod-class-precedence-list)
 
-   (%type :type c-class-type :accessor sod-class-type)
+   (%type :type c-class-type :reader sod-class-type)
 
-   (chain-head :type sod-class :accessor sod-class-chain-head)
-   (chain :type list :accessor sod-class-chain)
-   (chains :type list :accessor sod-class-chains)
+   (chain-head :type sod-class :reader sod-class-chain-head)
+   (chain :type list :reader sod-class-chain)
+   (chains :type list :reader sod-class-chains)
 
-   (%ilayout :type ilayout :accessor sod-class-ilayout)
-   (effective-methods :type list :accessor sod-class-effective-methods)
-   (vtables :type list :accessor sod-class-vtables)
+   (%ilayout :type ilayout :reader sod-class-ilayout)
+   (effective-methods :type list :reader sod-class-effective-methods)
+   (vtables :type list :reader sod-class-vtables)
 
    (state :initform nil :type (member nil :finalized broken)
-         :accessor sod-class-state))
+         :reader sod-class-state))
   (:documentation
    "Classes describe the layout and behaviour of objects.