[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/record 43d28bb: Remove eieio--object.
From: |
Lars Brinkhoff |
Subject: |
[Emacs-diffs] scratch/record 43d28bb: Remove eieio--object. |
Date: |
Wed, 29 Mar 2017 13:15:26 -0400 (EDT) |
branch: scratch/record
commit 43d28bbf0b87571c97450d321c73e9fd125f2e12
Author: Lars Brinkhoff <address@hidden>
Commit: Lars Brinkhoff <address@hidden>
Remove eieio--object.
---
lisp/emacs-lisp/eieio-base.el | 3 +--
lisp/emacs-lisp/eieio-core.el | 17 +++++------------
lisp/emacs-lisp/eieio.el | 3 +--
3 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 986d028..33c71ec 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -294,8 +294,7 @@ Second, any text properties will be stripped from strings."
(cond ((consp proposed-value)
;; Lists with something in them need special treatment.
(let* ((slot-idx (- (eieio--slot-name-index class slot)
- (eval-when-compile
- (length (cl-struct-slot-info 'eieio--object)))))
+ (eval-when-compile eieio--object-num-slots)))
(type (cl--slot-descriptor-type (aref (eieio--class-slots
class)
slot-idx)))
(classtype (eieio-persistent-slot-type-is-class-p type)))
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index d757fa2..c59f85d 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -108,18 +108,11 @@ Currently under control of this var:
(cl-declaim (optimize (safety 1))))
-(cl-defstruct (eieio--object
- (:type vector) ;; FIXME! ;We manage our own tagging system.
- (:constructor nil)
- (:copier nil))
- ;; `class-tag' holds a symbol, which is not the class name, but is instead
- ;; properly prefixed as an internal EIEIO thingy and which holds the class
- ;; object/struct in its `symbol-value' slot.
- class-tag)
-
-(eval-when-compile
- (defconst eieio--object-num-slots
- (length (cl-struct-slot-info 'eieio--object))))
+(eval-and-compile
+ (defconst eieio--object-num-slots 1))
+
+(defsubst eieio--object-class-tag (obj)
+ (aref obj 0))
(defsubst eieio--object-class (obj)
(eieio--object-class-tag obj))
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 2822adf..858b2fd 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -342,8 +342,7 @@ variable name of the same name as the slot."
(defun eieio-pcase-slot-index-from-index-table (index-table slot)
"Find the index to pass to `aref' to access SLOT."
(let ((index (gethash slot index-table)))
- (if index (+ (eval-when-compile
- (length (cl-struct-slot-info 'eieio--object)))
+ (if index (+ (eval-when-compile eieio--object-num-slots)
index))))
(pcase-defmacro eieio (&rest fields)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] scratch/record 43d28bb: Remove eieio--object.,
Lars Brinkhoff <=