aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/eieio.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 999d75f79e9..6482c4d052a 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -351,21 +351,20 @@ Elements of FIELDS can be of the form (NAME PAT) in which case the
351contents of field NAME is matched against PAT, or they can be of 351contents of field NAME is matched against PAT, or they can be of
352 the form NAME which is a shorthand for (NAME NAME)." 352 the form NAME which is a shorthand for (NAME NAME)."
353 (declare (debug (&rest [&or (sexp pcase-PAT) sexp]))) 353 (declare (debug (&rest [&or (sexp pcase-PAT) sexp])))
354 (let ((is (make-symbol "table"))) 354 ;; FIXME: This generates a horrendous mess of redundant let bindings.
355 ;; FIXME: This generates a horrendous mess of redundant let bindings. 355 ;; `pcase' needs to be improved somehow to introduce let-bindings more
356 ;; `pcase' needs to be improved somehow to introduce let-bindings more 356 ;; sparingly, or the byte-compiler needs to be taught to optimize
357 ;; sparingly, or the byte-compiler needs to be taught to optimize 357 ;; them away.
358 ;; them away. 358 ;; FIXME: `pcase' does not do a good job here of sharing tests&code among
359 ;; FIXME: `pcase' does not do a good job here of sharing tests&code among 359 ;; various branches.
360 ;; various branches. 360 `(and (pred eieio-object-p)
361 `(and (pred eieio-object-p)
362 ,@(mapcar (lambda (field) 361 ,@(mapcar (lambda (field)
363 (pcase-exhaustive field 362 (pcase-exhaustive field
364 (`(,name ,pat) 363 (`(,name ,pat)
365 `(app (pcase--flip eieio-oref ',name) ,pat)) 364 `(app (pcase--flip eieio-oref ',name) ,pat))
366 ((pred symbolp) 365 ((pred symbolp)
367 `(app (pcase--flip eieio-oref ',field) ,field)))) 366 `(app (pcase--flip eieio-oref ',field) ,field))))
368 fields)))) 367 field-s)))
369 368
370;;; Simple generators, and query functions. None of these would do 369;;; Simple generators, and query functions. None of these would do
371;; well embedded into an object. 370;; well embedded into an object.