(defun create-accessors (var name accessor) (let ((var-name (symb name '- (if (consp var) (car var) var)))) `(progn (defun ,var-name (struct) (,accessor struct)) (defun (setf ,var-name) (value struct) (setf (,accessor struct) value)))))Source Context