In Practical Common Lisp chapter 17. Object Reorientation: Classes section Accessor Functions, I was finding it difficult understanding the way SETF is being extended.
The functions:
(defun (setf customer-name) (name account)
  (setf (slot-value account 'customer-name) name))
bank-account class definition:
(defclass bank-account ()
  ((customer-name
    :initarg :customer-name
    :initform (error "Must supply a customer name."))
   (balance
    :initarg :balance
    :initform 0)
   (account-number
    :initform (incf *account-numbers*))
   account-type))
What I don't understand:
in the expression
(setf (customer-name my-account) "Sally Sue")does(customer-name my-account)return a SETFable slot-valuecustomer-nameof the the classbank-accountwhich thenSETFuses to set the value to "Sally Sue"?is
(setf (customer-name my-account) "Sally Sue")actually calling the function above?as defined above is
setf customer-namea function?in the function above is
customer-namein(setf customer-name)and'customer-namein the body referring to the same thing?the section states
second element is a symbol, typically the name of a function used to access the place the SETF function will set
if that's the case then why use the
slot-valuefunction inside the function's definition when the function can be used to access the place?