Christophe Turle <[EMAIL PROTECTED]> writes:

> how can i get the name of the accessor for a struct and one of its slot ?
> 
> inputs : struct symbol, slot symbol
> output : accessor symbol

(defun find-struct-slot-accessor (struct-name slot-name)
  (let* ((layout (kernel::compiler-layout-or-lose struct-name))
         (dd (kernel:layout-info layout))
         (slots (kernel:dd-slots dd))
         (slot-description (find slot-name slots :key #'kernel:dsd-name)))
    (kernel:dsd-accessor slot-description)))

(defstruct (foo (:conc-name foo.)) a b)

(find-struct-slot-accessor 'foo 'a)

Helmut.

Reply via email to