* 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.
(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
(`no-applicable-method
(setq method 'cl-no-applicable-method)
(setq specializers `(generic ,@specializers))
- (lambda (generic arg &rest args) (apply code arg generic args)))
+ (lambda (generic arg &rest args)
+ (apply code arg (cl--generic-name generic) (cons arg args))))
(_ code))))
(cl-generic-define-method
method (unless (memq kind '(nil :primary)) (list kind))
(defun eieio--class-precedence-c3 (class)
"Return all parents of CLASS in c3 order."
- (let ((parents (eieio--class-parents (cl--find-class class))))
+ (let ((parents (eieio--class-parents class)))
(eieio--c3-merge-lists
(list class)
(append
(list eieio--generic-subclass-generalizer))
\f
-;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "6aca3c1b5f751a01331761da45fc4f5c")
+;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "dba4205b1a0d7133f1311d975b4d0ebe")
;;; Generated autoloads from eieio-compat.el
(autoload 'eieio--defalias "eieio-compat" "\