summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-generic.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2016-07-14 15:05:49 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2016-07-14 15:05:49 -0400
commit452aa949bc4de77b1fba103de6b61e55b2ca8c0b (patch)
tree58319df24bba25748d2aa75177f582378157b752 /lisp/emacs-lisp/cl-generic.el
parent248d5dd13cd2ae0b1319a52b331e451fa7dd99c8 (diff)
downloademacs-452aa949bc4de77b1fba103de6b61e55b2ca8c0b.tar.gz
emacs-452aa949bc4de77b1fba103de6b61e55b2ca8c0b.tar.bz2
emacs-452aa949bc4de77b1fba103de6b61e55b2ca8c0b.zip
Fix eieio vs cl-generic incompatibilities found in Rudel (bug#23947)
* lisp/emacs-lisp/cl-generic.el (cl-generic-apply): New function. * lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Fix incorrect mapping between cl-no-applicable-method and EIEIO's no-applicable-method. * lisp/emacs-lisp/eieio-core.el (eieio--class-precedence-c3): `class' is not a symbol but a class object.
Diffstat (limited to 'lisp/emacs-lisp/cl-generic.el')
-rw-r--r--lisp/emacs-lisp/cl-generic.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index e5bab8dba99..4f263c6bb8d 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -671,6 +671,15 @@ FUN is the function that should be called when METHOD calls
(setq fun (cl-generic-call-method generic method fun)))
fun)))))
+(defun cl-generic-apply (generic args)
+ "Like `apply' but takes a cl-generic object rather than a function."
+ ;; Handy in cl-no-applicable-method, for example.
+ ;; In Common Lisp, generic-function objects are funcallable. Ideally
+ ;; we'd want the same in Elisp, but it would either require using a very
+ ;; different (and less efficient) representation of cl--generic objects,
+ ;; or non-trivial changes in the general infrastructure (compiler and such).
+ (apply (cl--generic-name generic) args))
+
(defun cl--generic-arg-specializer (method dispatch-arg)
(or (if (integerp dispatch-arg)
(nth dispatch-arg