diff options
| author | Stefan Monnier | 2015-04-14 23:04:45 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-04-14 23:04:45 -0400 |
| commit | 5de3427203ac1fc0badd01a447c65cf45ecf1403 (patch) | |
| tree | 92ef90e36b83bc01b784be317b15c1b538da81d9 | |
| parent | 17d667b3876920652152baa4eab24134940a0f30 (diff) | |
| download | emacs-5de3427203ac1fc0badd01a447c65cf45ecf1403.tar.gz emacs-5de3427203ac1fc0badd01a447c65cf45ecf1403.zip | |
* lisp/emacs-lisp/eieio-core.el (eieio--class): Derive from cl--class
(eieio--class-p): Remove, provided by cl-defstruct.
| -rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 272bb0768af..59d834837b0 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el | |||
| @@ -89,21 +89,8 @@ Currently under control of this var: | |||
| 89 | (cl-defstruct (eieio--class | 89 | (cl-defstruct (eieio--class |
| 90 | (:constructor nil) | 90 | (:constructor nil) |
| 91 | (:constructor eieio--class-make (name &aux (tag 'defclass))) | 91 | (:constructor eieio--class-make (name &aux (tag 'defclass))) |
| 92 | (:type vector) | 92 | (:include cl--class) |
| 93 | (:copier nil)) | 93 | (:copier nil)) |
| 94 | ;; We use an untagged cl-struct, with our own hand-made tag as first field | ||
| 95 | ;; (containing the symbol `defclass'). It would be better to use a normal | ||
| 96 | ;; cl-struct with its normal tag (e.g. so that cl-defstruct can define the | ||
| 97 | ;; predicate for us), but that breaks compatibility with .elc files compiled | ||
| 98 | ;; against older versions of EIEIO. | ||
| 99 | tag | ||
| 100 | ;; Fields we could inherit from cl--class (if we used a tagged cl-struct): | ||
| 101 | (name nil :type symbol) ;The type name. | ||
| 102 | (docstring nil :type string) | ||
| 103 | (parents nil :type (or eieio--class (list-of eieio--class))) | ||
| 104 | (slots nil :type (vector cl-slot-descriptor)) | ||
| 105 | (index-table nil :type hash-table) | ||
| 106 | ;; Fields specific to EIEIO classes: | ||
| 107 | children | 94 | children |
| 108 | initarg-tuples ;; initarg tuples list | 95 | initarg-tuples ;; initarg tuples list |
| 109 | (class-slots nil :type eieio--slot) | 96 | (class-slots nil :type eieio--slot) |
| @@ -152,12 +139,6 @@ Currently under control of this var: | |||
| 152 | (or (eieio--class-v class) class) | 139 | (or (eieio--class-v class) class) |
| 153 | class)) | 140 | class)) |
| 154 | 141 | ||
| 155 | (defsubst eieio--class-p (class) | ||
| 156 | "Return non-nil if CLASS is a valid class object." | ||
| 157 | (condition-case nil | ||
| 158 | (eq (aref class 0) 'defclass) | ||
| 159 | (error nil))) | ||
| 160 | |||
| 161 | (defun class-p (class) | 142 | (defun class-p (class) |
| 162 | "Return non-nil if CLASS is a valid class vector. | 143 | "Return non-nil if CLASS is a valid class vector. |
| 163 | CLASS is a symbol." ;FIXME: Is it a vector or a symbol? | 144 | CLASS is a symbol." ;FIXME: Is it a vector or a symbol? |