aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2020-05-10 13:51:51 -0400
committerStefan Monnier2020-05-10 13:51:51 -0400
commit0bb9aeddd6ac713c751b3b6586d62d2dcc8465c0 (patch)
treedc1c69db856178ae2ee68a3863e22f3919cd9a7f
parent8f808be68bfab51fe282e7ee2f6bc8c28bf7a442 (diff)
downloademacs-0bb9aeddd6ac713c751b3b6586d62d2dcc8465c0.tar.gz
emacs-0bb9aeddd6ac713c751b3b6586d62d2dcc8465c0.zip
* lisp/emacs-lisp/eieio.el (eieio pcase macro): Remove unused var `is`
-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.