aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/cl-macs.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/cl-macs.el')
-rw-r--r--lisp/emacs-lisp/cl-macs.el17
1 files changed, 2 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index e2c13534054..2431e658368 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -3337,19 +3337,6 @@ To see the documentation for a defined struct type, use
3337 3337
3338;;; Add cl-struct support to pcase 3338;;; Add cl-struct support to pcase
3339 3339
3340;;In use by comp.el
3341(defun cl--struct-all-parents (class) ;FIXME: Merge with `cl--class-allparents'
3342 (when (cl--struct-class-p class)
3343 (let ((res ())
3344 (classes (list class)))
3345 ;; BFS precedence.
3346 (while (let ((class (pop classes)))
3347 (push class res)
3348 (setq classes
3349 (append classes
3350 (cl--class-parents class)))))
3351 (nreverse res))))
3352
3353;;;###autoload 3340;;;###autoload
3354(pcase-defmacro cl-struct (type &rest fields) 3341(pcase-defmacro cl-struct (type &rest fields)
3355 "Pcase patterns that match cl-struct EXPVAL of type TYPE. 3342 "Pcase patterns that match cl-struct EXPVAL of type TYPE.
@@ -3395,8 +3382,8 @@ the form NAME which is a shorthand for (NAME NAME)."
3395 (let ((c1 (cl--find-class t1)) 3382 (let ((c1 (cl--find-class t1))
3396 (c2 (cl--find-class t2))) 3383 (c2 (cl--find-class t2)))
3397 (and c1 c2 3384 (and c1 c2
3398 (not (or (memq c1 (cl--struct-all-parents c2)) 3385 (not (or (memq t1 (cl--class-allparents c2))
3399 (memq c2 (cl--struct-all-parents c1))))))) 3386 (memq t2 (cl--class-allparents c1)))))))
3400 (let ((c1 (and (symbolp t1) (cl--find-class t1)))) 3387 (let ((c1 (and (symbolp t1) (cl--find-class t1))))
3401 (and c1 (cl--struct-class-p c1) 3388 (and c1 (cl--struct-class-p c1)
3402 (funcall orig (cl--defstruct-predicate t1) 3389 (funcall orig (cl--defstruct-predicate t1)