Function: cl-struct-slot-info
cl-struct-slot-info is an autoloaded and byte-compiled function
defined in cl-macs.el.gz.
Signature
(cl-struct-slot-info STRUCT-TYPE)
Documentation
Return a list of slot names of struct STRUCT-TYPE.
Each entry is a list (SLOT-NAME . OPTS), where SLOT-NAME is a
slot name symbol and OPTS is a list of slot options given to
cl-defstruct. Dummy slots that represent the struct name and
slots skipped by :initial-offset may appear in the list.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-macs.el.gz
;;;###autoload
(defun cl-struct-slot-info (struct-type)
"Return a list of slot names of struct STRUCT-TYPE.
Each entry is a list (SLOT-NAME . OPTS), where SLOT-NAME is a
slot name symbol and OPTS is a list of slot options given to
`cl-defstruct'. Dummy slots that represent the struct name and
slots skipped by :initial-offset may appear in the list."
(declare (side-effect-free t) (pure t))
(let* ((class (cl--struct-get-class struct-type))
(slots (cl--struct-class-slots class))
(type (cl--struct-class-type class))
(descs (if type () (list '(cl-tag-slot)))))
(dotimes (i (length slots))
(let ((slot (aref slots i)))
(push `(,(cl--slot-descriptor-name slot)
,(cl--slot-descriptor-initform slot)
,@(if (not (eq (cl--slot-descriptor-type slot) t))
`(:type ,(cl--slot-descriptor-type slot)))
,@(cl--alist-to-plist (cl--slot-descriptor-props slot)))
descs)))
(nreverse descs)))