aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/cl-macs.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 68abe67698c..809e9223b43 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2672,15 +2672,17 @@ non-nil value, that slot cannot be set via `setf'.
2672 (let ((accessor (intern (format "%s%s" conc-name slot)))) 2672 (let ((accessor (intern (format "%s%s" conc-name slot))))
2673 (push slot slots) 2673 (push slot slots)
2674 (push (nth 1 desc) defaults) 2674 (push (nth 1 desc) defaults)
2675 (push `(cl-defsubst ,accessor (cl-x) 2675 (push `(cl-defsubst ,accessor (x)
2676 ,(format "Access slot \"%s\" of `%s' struct X."
2677 slot struct)
2676 (declare (side-effect-free t)) 2678 (declare (side-effect-free t))
2677 ,@(and pred-check 2679 ,@(and pred-check
2678 (list `(or ,pred-check 2680 (list `(or ,pred-check
2679 (signal 'wrong-type-argument 2681 (signal 'wrong-type-argument
2680 (list ',name cl-x))))) 2682 (list ',name x)))))
2681 ,(if (memq type '(nil vector)) `(aref cl-x ,pos) 2683 ,(if (memq type '(nil vector)) `(aref x ,pos)
2682 (if (= pos 0) '(car cl-x) 2684 (if (= pos 0) '(car x)
2683 `(nth ,pos cl-x)))) 2685 `(nth ,pos x))))
2684 forms) 2686 forms)
2685 (if (cadr (memq :read-only (cddr desc))) 2687 (if (cadr (memq :read-only (cddr desc)))
2686 (push `(gv-define-expander ,accessor 2688 (push `(gv-define-expander ,accessor