diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-05-18 17:13:37 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-05-18 17:13:52 -0400 |
commit | 2c47eaa18a4a3f7eb53ed826d8c5d018ac843586 (patch) | |
tree | ad4a44835e49268ca232f4ffefa414c6455e079f /lisp/emacs-lisp/eieio-core.el | |
parent | 0fa959db203f9d6c2d09cb1e026b5b99a5274e79 (diff) | |
download | emacs-2c47eaa18a4a3f7eb53ed826d8c5d018ac843586.tar.gz emacs-2c47eaa18a4a3f7eb53ed826d8c5d018ac843586.tar.bz2 emacs-2c47eaa18a4a3f7eb53ed826d8c5d018ac843586.zip |
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Use a closure
Diffstat (limited to 'lisp/emacs-lisp/eieio-core.el')
-rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 2923dffd951..34b4575182e 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -347,19 +347,20 @@ See `defclass' for more information." (when eieio-backward-compatibility (let ((csym (intern (concat (symbol-name cname) "-list-p")))) (defalias csym - `(lambda (obj) - ,(format - "Test OBJ to see if it a list of objects which are a child of type %s" - cname) - (when (listp obj) - (let ((ans t)) ;; nil is valid - ;; Loop over all the elements of the input list, test - ;; each to make sure it is a child of the desired object class. - (while (and obj ans) - (setq ans (and (eieio-object-p (car obj)) - (object-of-class-p (car obj) ,cname))) - (setq obj (cdr obj))) - ans)))) + (lambda (obj) + (:documentation + (format + "Test OBJ to see if it a list of objects which are a child of type %s" + cname)) + (when (listp obj) + (let ((ans t)) ;; nil is valid + ;; Loop over all the elements of the input list, test + ;; each to make sure it is a child of the desired object class. + (while (and obj ans) + (setq ans (and (eieio-object-p (car obj)) + (object-of-class-p (car obj) 'cname))) + (setq obj (cdr obj))) + ans)))) (make-obsolete csym (format "use (cl-typep ... \\='(list-of %s)) instead" cname) |