Major effort to plug slot-name leaks.
[sod] / src / class-output.lisp
index 8880df5..35269a7 100644 (file)
                    sequencer))
 
 (defmethod hook-output progn ((class sod-class) reason sequencer)
-  (with-slots (ilayout vtables methods effective-methods) class
+  (with-slots ((ilayout %ilayout) vtables methods effective-methods) class
     (hook-output ilayout reason sequencer)
     (dolist (method methods) (hook-output method reason sequencer))
     (dolist (method effective-methods) (hook-output method reason sequencer))
     (hook-output item reason sequencer)))
 
 (defmethod hook-output progn ((ilayout ilayout) (reason (eql :h)) sequencer)
-  (with-slots (class ichains) ilayout
+  (with-slots ((class %class) ichains) ilayout
     (sequence-output (stream sequencer)
       ((class :ilayout :start)
        (format stream "/* Instance layout. */~@
       (hook-output ichain 'ilayout sequencer))))
 
 (defmethod hook-output progn ((ichain ichain) (reason (eql :h)) sequencer)
-  (with-slots (class chain-head chain-tail) ichain
+  (with-slots ((class %class) chain-head chain-tail) ichain
     (when (eq class chain-tail)
       (sequence-output (stream sequencer)
        :constraint ((class :ichains :start)
 (defmethod hook-output progn ((ichain ichain)
                              (reason (eql 'ilayout))
                              sequencer)
-  (with-slots (class chain-head chain-tail) ichain
+  (with-slots ((class %class) chain-head chain-tail) ichain
     (sequence-output (stream sequencer)
       ((class :ilayout :slots)
        (format stream "  union ~A ~A;~%"
 (defmethod hook-output progn ((vtptr vtable-pointer)
                              (reason (eql :h))
                              sequencer)
-  (with-slots (class chain-head chain-tail) vtptr
+  (with-slots ((class %class) chain-head chain-tail) vtptr
     (sequence-output (stream sequencer)
       ((class :ichain chain-head :slots)
        (format stream "  const struct ~A *_vt;~%"
     (hook-output slot reason sequencer)))
 
 (defmethod hook-output progn ((islots islots) (reason (eql :h)) sequencer)
-  (with-slots (class subclass slots) islots
+  (with-slots ((class %class) subclass slots) islots
     (sequence-output (stream sequencer)
       ((subclass :ichain (sod-class-chain-head class) :slots)
        (format stream "  struct ~A ~A;~%"
 (defmethod hook-output progn ((method sod-method)
                              (reason (eql :h))
                              sequencer)
-  (with-slots (class) method
+  (with-slots ((class %class)) method
     (sequence-output (stream sequencer)
       ((class :methods)
        (let ((type (sod-method-function-type method)))
         (format stream ";~%"))))))
 
 (defmethod hook-output progn ((vtable vtable) (reason (eql :h)) sequencer)
-  (with-slots (class chain-head chain-tail) vtable
+  (with-slots ((class %class) chain-head chain-tail) vtable
     (when (eq class chain-tail)
       (sequence-output (stream sequencer)
        :constraint ((class :vtables :start)
               class (sod-class-nickname chain-head))))))
 
 (defmethod hook-output progn ((vtmsgs vtmsgs) (reason (eql :h)) sequencer)
-  (with-slots (class subclass chain-head chain-tail) vtmsgs
+  (with-slots ((class %class) subclass chain-head chain-tail) vtmsgs
     (sequence-output (stream sequencer)
       ((subclass :vtable chain-head :slots)
        (format stream "  struct ~A ~A;~%"
                              (reason (eql 'vtmsgs))
                              sequencer)
   (when (vtmsgs-entries vtmsgs)
-    (with-slots (class subclass) vtmsgs
+    (with-slots ((class %class) subclass) vtmsgs
       (sequence-output (stream sequencer)
        :constraint ((subclass :vtmsgs :start)
                     (subclass :vtmsgs class :start)
 (defmethod hook-output progn ((cptr class-pointer)
                              (reason (eql :h))
                              sequencer)
-  (with-slots (class chain-head metaclass meta-chain-head) cptr
+  (with-slots ((class %class) chain-head metaclass meta-chain-head) cptr
     (sequence-output (stream sequencer)
       ((class :vtable chain-head :slots)
        (format stream "  const ~A *~:[_class~;~:*_cls_~A~];~%"
                    (sod-class-nickname meta-chain-head)))))))
 
 (defmethod hook-output progn ((boff base-offset) (reason (eql :h)) sequencer)
-  (with-slots (class chain-head) boff
+  (with-slots ((class %class) chain-head) boff
     (sequence-output (stream sequencer)
       ((class :vtable chain-head :slots)
        (write-line "  size_t _base;" stream)))))
 (defmethod hook-output progn ((choff chain-offset)
                              (reason (eql :h))
                              sequencer)
-  (with-slots (class chain-head target-head) choff
+  (with-slots ((class %class) chain-head target-head) choff
     (sequence-output (stream sequencer)
       ((class :vtable chain-head :slots)
        (format stream "  ptrdiff_t _off_~A;~%"
@@ -427,7 +427,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((method delegating-direct-method)
                              (reason (eql :c))
                              sequencer)
-  (with-slots (class body) method
+  (with-slots ((class %class) body) method
     (unless body
       (return-from hook-output))
     (sequence-output (stream sequencer)
@@ -442,7 +442,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((method sod-method)
                              (reason (eql :c))
                              sequencer)
-  (with-slots (class body) method
+  (with-slots ((class %class) body) method
     (unless body
       (return-from hook-output))
     (sequence-output (stream sequencer)
@@ -464,7 +464,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((method basic-effective-method)
                              (reason (eql :c))
                              sequencer)
-  (with-slots (class functions) method
+  (with-slots ((class %class) functions) method
     (sequence-output (stream sequencer)
       ((class :effective-methods)
        (dolist (func functions)
@@ -474,7 +474,7 @@ const struct ~A ~A__classobj = {~%"
 ;;; Vtables.
 
 (defmethod hook-output progn ((vtable vtable) (reason (eql :c)) sequencer)
-  (with-slots (class chain-head chain-tail) vtable
+  (with-slots ((class %class) chain-head chain-tail) vtable
     (sequence-output (stream sequencer)
       :constraint ((class :vtables :start)
                   (class :vtable chain-head :start)
@@ -492,7 +492,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((cptr class-pointer)
                              (reason (eql :c))
                              sequencer)
-  (with-slots (class chain-head metaclass meta-chain-head) cptr
+  (with-slots ((class %class) chain-head metaclass meta-chain-head) cptr
     (sequence-output (stream sequencer)
       :constraint ((class :vtable chain-head :start)
                   (class :vtable chain-head :class-pointer metaclass)
@@ -508,7 +508,7 @@ const struct ~A ~A__classobj = {~%"
               (sod-class-nickname metaclass))))))
 
 (defmethod hook-output progn ((boff base-offset) (reason (eql :c)) sequencer)
-  (with-slots (class chain-head) boff
+  (with-slots ((class %class) chain-head) boff
     (sequence-output (stream sequencer)
       :constraint ((class :vtable chain-head :start)
                   (class :vtable chain-head :base-offset)
@@ -522,7 +522,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((choff chain-offset)
                              (reason (eql :c))
                              sequencer)
-  (with-slots (class chain-head target-head) choff
+  (with-slots ((class %class) chain-head target-head) choff
     (sequence-output (stream sequencer)
       :constraint ((class :vtable chain-head :start)
                   (class :vtable chain-head :chain-offset target-head)
@@ -535,7 +535,7 @@ const struct ~A ~A__classobj = {~%"
               (sod-class-nickname target-head))))))
 
 (defmethod hook-output progn ((vtmsgs vtmsgs) (reason (eql :c)) sequencer)
-  (with-slots (class subclass chain-head) vtmsgs
+  (with-slots ((class %class) subclass chain-head) vtmsgs
     (sequence-output (stream sequencer)
       :constraint ((subclass :vtable chain-head :start)
                   (subclass :vtable chain-head :vtmsgs class :start)
@@ -551,7 +551,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((entry method-entry)
                              (reason (eql :c))
                              sequencer)
-  (with-slots (method chain-head chain-tail role) entry
+  (with-slots ((method %method) chain-head chain-tail role) entry
     (let* ((message (effective-method-message method))
           (class (effective-method-class method))
           (super (sod-message-class message)))
@@ -567,7 +567,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((ichain ichain)
                              (reason (eql 'class))
                              sequencer)
-  (with-slots (class chain-head) ichain
+  (with-slots ((class %class) chain-head) ichain
     (sequence-output (stream sequencer)
       :constraint ((*instance-class* :object :start)
                   (*instance-class* :object chain-head :ichain :start)
@@ -582,7 +582,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((islots islots)
                              (reason (eql 'class))
                              sequencer)
-  (with-slots (class) islots
+  (with-slots ((class %class)) islots
     (let ((chain-head (sod-class-chain-head class)))
       (sequence-output (stream sequencer)
        :constraint ((*instance-class* :object chain-head :ichain :start)
@@ -598,7 +598,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((vtptr vtable-pointer)
                              (reason (eql 'class))
                              sequencer)
-  (with-slots (class chain-head chain-tail) vtptr
+  (with-slots ((class %class) chain-head chain-tail) vtptr
     (sequence-output (stream sequencer)
       :constraint ((*instance-class* :object chain-head :ichain :start)
                   (*instance-class* :object chain-head :vtable)
@@ -651,7 +651,7 @@ const struct ~A ~A__classobj = {~%"
 (defmethod hook-output progn ((slot effective-slot)
                              (reason (eql 'class))
                              sequencer)
-  (with-slots (class (dslot slot)) slot
+  (with-slots ((class %class) (dslot slot)) slot
     (let ((instance *instance-class*)
          (super (sod-slot-class dslot)))
       (sequence-output (stream sequencer)