diff options
author | Fabián Ezequiel Gallina <fgallina@gnu.org> | 2015-01-28 01:31:15 -0300 |
---|---|---|
committer | Fabián Ezequiel Gallina <fgallina@gnu.org> | 2015-01-28 01:31:15 -0300 |
commit | 5491fd1098d27b3ba3db054076b9ab60fb3558dc (patch) | |
tree | 65f6f54127714eb9634b83e5d780d75ab7d85252 /lisp/emacs-lisp/eieio-core.el | |
parent | 028ddef7a2b6662ac602ea70d308deecbc69b4db (diff) | |
parent | 2668ac1aaecfe62c80a4fbdfc27a38e384594d26 (diff) | |
download | emacs-5491fd1098d27b3ba3db054076b9ab60fb3558dc.tar.gz emacs-5491fd1098d27b3ba3db054076b9ab60fb3558dc.tar.bz2 emacs-5491fd1098d27b3ba3db054076b9ab60fb3558dc.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/emacs-lisp/eieio-core.el')
-rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 7492f0522ab..d8d39020d0f 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -224,9 +224,9 @@ Return nil if that option doesn't exist." (defsubst eieio-object-p (obj) "Return non-nil if OBJ is an EIEIO object." (and (vectorp obj) - (condition-case nil - (eq (aref (eieio--object-class-object obj) 0) 'defclass) - (error nil)))) + (> (length obj) 0) + (eq (symbol-function (eieio--class-tag obj)) + :quick-object-witness-check))) (defalias 'object-p 'eieio-object-p) @@ -539,6 +539,7 @@ See `defclass' for more information." ;; objects readable. (tag (intern (format "eieio-class-tag--%s" cname)))) (set tag newc) + (fset tag :quick-object-witness-check) (setf (eieio--object-class-tag cache) tag) (let ((eieio-skip-typecheck t)) ;; All type-checking has been done to our satisfaction @@ -1223,9 +1224,10 @@ method invocation orders of the involved classes." ;; specializer in a defmethod form. ;; So we can ignore types that are not known to denote classes. (and (class-p type) - ;; Prefer (aref ,name 0) over (eieio--class-tag ,name) so that - ;; the tagcode is identical to the tagcode used for cl-struct. - `(50 . (and (vectorp ,name) (aref ,name 0))))) + ;; Use the exact same code as for cl-struct, so that methods + ;; that dispatch on both kinds of objects get to share this + ;; part of the dispatch code. + `(50 . ,(cl--generic-struct-tag name)))) (add-function :before-until cl-generic-tag-types-function #'eieio--generic-tag-types) |