Skip to content

Instantly share code, notes, and snippets.

@Lovesan
Created August 28, 2025 14:56
Show Gist options
  • Select an option

  • Save Lovesan/a7d53f465f6fbc11ba30c524087e3e80 to your computer and use it in GitHub Desktop.

Select an option

Save Lovesan/a7d53f465f6fbc11ba30c524087e3e80 to your computer and use it in GitHub Desktop.
logging-class
(defclass logging-class (standard-class)
())
(defmethod slot-value-using-class :after ((class logging-class) obj slotd)
(format t "Access to slot ~a of ~s ~%"
(slot-definition-name slotd)
obj))
(defmethod (setf slot-value-using-class) :after (new-value (class logging-class) obj slotd)
(format t "Setting the slot ~a of ~s to value ~s ~%"
(slot-definition-name slotd)
obj
new-value))
(defmethod validate-superclass ((class logging-class)
(superclass standard-class))
t)
(defclass my-object ()
((x :initform nil :initarg :x :accessor my-x))
(:metaclass logging-class))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment