emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shrinking EIEIO objects


From: Stefan Monnier
Subject: Shrinking EIEIO objects
Date: Tue, 30 Dec 2014 12:59:37 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Hi Eric,

I'd like to install something like the patch below into Emacs's master.
What it does (along with various other side changes) is shorten the
object header from 3 fields (the constant `object', the class name, and
an object "name" field) to just one (an interned symbol with an "eieio-"
prefix, referring to the class object).
Among the side things it does, I'd mention:
- add "eieio--" prefixes to a few more entities.
- use hashtables rather than obarrays.
- use closures instead of backquoted lambdas.
- use call-next-method in the various definitions of `clone'.
- redirect defmethods when called on an alias.
- use class objects (vectors) rather than class names (symbols) at more places.

Any objection?


        Stefan


diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d8bb1c8..209c833 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,114 @@
+2014-12-29  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects
+       additionally to class names.
+
+       * emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding.
+       (object): Remove first (constant) slot; rename second to `class-tag'.
+       (eieio--object-class-object, eieio--object-class-name): New funs
+       to replace eieio--object-class.
+       (eieio--class-object, eieio--class-p): New functions.
+       (same-class-fast-p): Make it a defsubst, change its implementation
+       to check the class objects rather than their names.
+       (eieio-object-p): Rewrite.
+       (eieio-defclass): Adjust the object initialization according to the new
+       object layout.
+       (eieio--scoped-class): Declare it returns a class object (not a class
+       name any more).  Adjust calls accordingly (along with calls to
+       eieio--with-scoped-class).
+       (eieio--slot-name-index): Rename from eieio-slot-name-index and change
+       its class arg to be a class object.  Adjust callers accordingly.
+       (eieio-slot-originating-class-p): Make its start-class arg a class
+       object.  Adjust all callers.
+       (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute.
+       Make its `class' arg a class object.  Adjust all callers.
+
+       * emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value):
+       Use eieio--slot-name-index rather than eieio-slot-name-index.
+
+2014-12-23  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/eieio.el (make-instance): Simplify by not adding an object
+       name argument.
+       (eieio-object-name): Use eieio-object-name-string.
+       (eieio--object-names): New const.
+       (eieio-object-name-string, eieio-object-set-name-string): Re-implement
+       using a hashtable rather than a built-in slot.
+       (eieio-constructor): Rename from `constructor'.  Remove `newname' arg.
+       (clone): Don't mess with the object's "name".
+
+       * emacs-lisp/eieio-custom.el (eieio-widget-test): Remove dummy arg.
+       (eieio-object-value-get): Use eieio-object-set-name-string.
+
+       * emacs-lisp/eieio-core.el (eieio--defalias): Follow aliases.
+       (eieio--object): Remove `name' field.
+       (eieio-defclass): Adjust to new convention where constructors don't
+       take an "object name" any more.
+       (eieio--defgeneric-init-form, eieio--defmethod): Follow aliases.
+       (eieio-validate-slot-value, eieio-oset-default)
+       (eieio-slot-name-index): Don't hardcode eieio--object-num-slots.
+       (eieio-generic-call-primary-only): Simplify.
+
+       * emacs-lisp/eieio-base.el (clone) <eieio-instance-inheritor>:
+       Use call-next-method.
+       (eieio-constructor): Rename from `constructor'.
+       (eieio-persistent-convert-list-to-object): Drop objname.
+       (eieio-persistent-validate/fix-slot-value): Don't hardcode
+       eieio--object-num-slots.
+       (eieio-named): Use a normal slot.
+       (slot-missing) <eieio-named>: Remove.
+       (eieio-object-name-string, eieio-object-set-name-string, clone)
+       <eieio-named>: New methods.
+
+2014-12-22  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/eieio-core.el (eieio--class-v): Rename from class-v.
+       (method-*): Add a "eieio--" prefix to those constants.
+
+       * emacs-lisp/eieio.el: Move edebug specs to the corresponding macro.
+
+       * emacs-lisp/eieio-speedbar.el: Use lexical-binding.
+
+2014-12-22  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is
+       `eieio-default-superclass'.
+
+       * emacs-lisp/eieio-datadebug.el: Use lexical-binding.
+
+       * emacs-lisp/eieio-custom.el: Use lexical-binding.
+       (eieio-object-value-to-abstract): Simplify.
+
+       * emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan.
+       (eieio-build-class-alist): Use dolist.
+       (eieio-all-generic-functions): Adjust to use of hashtables.
+
+       * emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to
+       symbol-hashtable.  It contains a hashtable instead of an obarray.
+       (generic-p): Use symbol property `eieio-method-hashtable' instead of
+       `eieio-method-obarray'.
+       (generic-primary-only-p, generic-primary-only-one-p):
+       Slight optimization.
+       (eieio-defclass-autoload-map): Use a hashtable instead of an obarray.
+       (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly.
+       (eieio-class-un-autoload): Use autoload-do-load.
+       (eieio-defclass): Use dolist, cl-pushnew, cl-callf.
+       Use new cl-deftype-satisfies.  Adjust to use of hashtables.
+       Don't hardcode the value of eieio--object-num-slots.
+       (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg.
+       Use a closure rather than a backquoted lambda.
+       (eieio--defmethod): Adjust call accordingly.  Set doc-string via the
+       function-documentation property.
+       (eieio-slot-originating-class-p, eieio-slot-name-index)
+       (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add)
+       (eieio-generic-form): Adjust to use of hashtables.
+       (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take
+       additional class argument.
+       (eieio-generic-call-methodname): Remove, unused.
+
+       * emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p):
+       Prefer \' to $.
+
 2014-12-22  Stefan Monnier  <address@hidden>
 
        * completion.el: Use post-self-insert-hook (bug#19400).
@@ -95,8 +206,8 @@
        * electric.el (Electric-pop-up-window):
        * help.el (resize-temp-buffer-window): Call fit-window-to-buffer
        with `preserve-size' t.
-       * minibuffer.el (minibuffer-completion-help): Use
-       `resize-temp-buffer-window' instead of `fit-window-to-buffer'
+       * minibuffer.el (minibuffer-completion-help):
+       Use `resize-temp-buffer-window' instead of `fit-window-to-buffer'
        (Bug#19355).  Preserve size of completions window.
        * register.el (register-preview): Preserve size of register
        preview window.
@@ -106,8 +217,8 @@
        `window-preserve-size'.
        (window-min-pixel-size, window--preservable-size)
        (window-preserve-size, window-preserved-size)
-       (window--preserve-size, window--min-size-ignore-p): New
-       functions.
+       (window--preserve-size, window--min-size-ignore-p):
+       New functions.
        (window-min-size, window-min-delta, window--resizable)
        (window--resize-this-window, split-window-below)
        (split-window-right): Amend doc-string.
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index a1c2cb5..e841ed6 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -63,25 +63,10 @@ SLOT-NAME is the offending slot.  FN is the function 
signaling the error."
     ;; Throw the regular signal.
     (call-next-method)))
 
-(defmethod clone ((obj eieio-instance-inheritor) &rest params)
+(defmethod clone ((obj eieio-instance-inheritor) &rest _params)
   "Clone OBJ, initializing `:parent' to OBJ.
 All slots are unbound, except those initialized with PARAMS."
-  (let ((nobj (make-vector (length obj) eieio-unbound))
-       (nm (eieio--object-name obj))
-       (passname (and params (stringp (car params))))
-       (num 1))
-    (aset nobj 0 'object)
-    (setf (eieio--object-class nobj) (eieio--object-class obj))
-    ;; The following was copied from the default clone.
-    (if (not passname)
-       (save-match-data
-         (if (string-match "-\\([0-9]+\\)" nm)
-             (setq num (1+ (string-to-number (match-string 1 nm)))
-                   nm (substring nm 0 (match-beginning 0))))
-         (setf (eieio--object-name nobj) (concat nm "-" (int-to-string num))))
-      (setf (eieio--object-name nobj) (car params)))
-    ;; Now initialize from params.
-    (if params (shared-initialize nobj (if passname (cdr params) params)))
+  (let ((nobj (call-next-method)))
     (oset nobj parent-instance obj)
     nobj))
 
@@ -155,7 +140,7 @@ Multiple calls to `make-instance' will return this 
object."))
 A singleton is a class which will only ever have one instance."
   :abstract t)
 
-(defmethod constructor :STATIC ((class eieio-singleton) _name &rest _slots)
+(defmethod eieio-constructor :STATIC ((class eieio-singleton) &rest _slots)
   "Constructor for singleton CLASS.
 NAME and SLOTS initialize the new object.
 This constructor guarantees that no matter how many you request,
@@ -270,7 +255,7 @@ malicious code.
 Note: This function recurses when a slot of :type of some object is
 identified, and needing more object creation."
   (let ((objclass (nth 0 inputlist))
-       (objname (nth 1 inputlist))
+       ;; (objname (nth 1 inputlist))
        (slots (nthcdr 2 inputlist))
        (createslots nil))
 
@@ -293,7 +278,7 @@ identified, and needing more object creation."
 
       (setq slots (cdr (cdr slots))))
 
-    (apply 'make-instance objclass objname (nreverse createslots))
+    (apply #'make-instance objclass (nreverse createslots))
 
     ;;(eval inputlist)
     ))
@@ -305,11 +290,13 @@ constructor functions are considered valid.
 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 nil slot))
+        (let ((slot-idx (eieio--slot-name-index (eieio--class-v class)
+                                                 nil slot))
               (type nil)
               (classtype nil))
-          (setq slot-idx (- slot-idx 3))
-          (setq type (aref (eieio--class-public-type (class-v class))
+          (setq slot-idx (- slot-idx
+                             (eval-when-compile eieio--object-num-slots)))
+          (setq type (aref (eieio--class-public-type (eieio--class-v class))
                            slot-idx))
 
           (setq classtype (eieio-persistent-slot-type-is-class-p
@@ -375,13 +362,13 @@ Second, any text properties will be stripped from 
strings."
   )
 
 (defun eieio-persistent-slot-type-is-class-p (type)
-  "Return the class refered to in TYPE.
+  "Return the class referred to in TYPE.
 If no class is referenced there, then return nil."
   (cond ((class-p type)
         ;; If the type is a class, then return it.
         type)
-
-       ((and (symbolp type) (string-match "-child$" (symbol-name type))
+        ;; FIXME: foo-child should not be a valid type!
+       ((and (symbolp type) (string-match "-child\\'" (symbol-name type))
              (class-p (intern-soft (substring (symbol-name type) 0
                                               (match-beginning 0)))))
         ;; If it is the predicate ending with -child, then return
@@ -389,8 +376,8 @@ If no class is referenced there, then return nil."
         ;; class is the same as if we used -child, so no further work needed.
         (intern-soft (substring (symbol-name type) 0
                                 (match-beginning 0))))
-
-       ((and (symbolp type) (string-match "-list$" (symbol-name type))
+        ;; FIXME: foo-list should not be a valid type!
+       ((and (symbolp type) (string-match "-list\\'" (symbol-name type))
              (class-p (intern-soft (substring (symbol-name type) 0
                                               (match-beginning 0)))))
         ;; If it is the predicate ending with -list, then return
@@ -463,34 +450,38 @@ instance."
 
 
 ;;; Named object
-;;
-;; Named objects use the objects `name' as a slot, and that slot
-;; is accessed with the `object-name' symbol.
 
 (defclass eieio-named ()
-  ()
-  "Object with a name.
-Name storage already occurs in an object.  This object provides get/set
-access to it."
+  ((object-name :initarg :object-name :initform nil))
+  "Object with a name."
   :abstract t)
 
-(defmethod slot-missing ((obj eieio-named)
-                        slot-name operation &optional new-value)
-  "Called when a non-existent slot is accessed.
-For variable `eieio-named', provide an imaginary `object-name' slot.
-Argument OBJ is the named object.
-Argument SLOT-NAME is the slot that was attempted to be accessed.
-OPERATION is the type of access, such as `oref' or `oset'.
-NEW-VALUE is the value that was being set into SLOT if OPERATION were
-a set type."
-  (if (memq slot-name '(object-name :object-name))
-      (cond ((eq operation 'oset)
-            (if (not (stringp new-value))
-                (signal 'invalid-slot-type
-                        (list obj slot-name 'string new-value)))
-            (eieio-object-set-name-string obj new-value))
-           (t (eieio-object-name-string obj)))
-    (call-next-method)))
+(defmethod eieio-object-name-string ((obj eieio-named))
+  "Return a string which is OBJ's name."
+  (or (slot-value obj 'object-name)
+      (symbol-name (eieio-object-class obj))))
+
+(defmethod eieio-object-set-name-string ((obj eieio-named) name)
+  "Set the string which is OBJ's NAME."
+  (eieio--check-type stringp name)
+  (eieio-oset obj 'object-name name))
+
+(defmethod clone ((obj eieio-named) &rest params)
+  "Clone OBJ, initializing `:parent' to OBJ.
+All slots are unbound, except those initialized with PARAMS."
+  (let* ((newname (and (stringp (car params)) (pop params)))
+         (nobj (apply #'call-next-method obj params))
+         (nm (slot-value obj 'object-name)))
+    (eieio-oset obj 'object-name
+                (or newname
+                    (save-match-data
+                      (if (and nm (string-match "-\\([0-9]+\\)" nm))
+                          (let ((num (1+ (string-to-number
+                                          (match-string 1 nm)))))
+                            (concat (substring nm 0 (match-beginning 0))
+                                    "-" (int-to-string num)))
+                        (concat nm "-1")))))
+    nobj))
 
 (provide 'eieio-base)
 
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index 2897ce9..924886c 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -39,6 +39,9 @@
   "Like `defalias', but with less side-effects.
 More specifically, it has no side-effects at all when the new function
 definition is the same (`eq') as the old one."
+  (while (and (fboundp name) (symbolp (symbol-function name)))
+    ;; Follow aliases, so methods applied to obsolete aliases still work.
+    (setq name (symbol-function name)))
   (unless (and (fboundp name)
                (eq (symbol-function name) body))
     (defalias name body)))
@@ -98,17 +101,14 @@ default setting for optimization purposes.")
   "A stack of the classes currently in scope during method invocation.")
 
 (defun eieio--scoped-class ()
-  "Return the class currently in scope, or nil."
+  "Return the class object currently in scope, or nil."
   (car-safe eieio--scoped-class-stack))
 
 (defmacro eieio--with-scoped-class (class &rest forms)
   "Set CLASS as the currently scoped class while executing FORMS."
   (declare (indent 1))
-  `(unwind-protect
-       (progn
-        (push ,class eieio--scoped-class-stack)
-        ,@forms)
-     (pop eieio--scoped-class-stack)))
+  `(let ((eieio--scoped-class-stack (cons ,class eieio--scoped-class-stack)))
+     ,@forms))
 
 ;;;
 ;; Field Accessors
@@ -132,10 +132,10 @@ default setting for optimization purposes.")
        (defconst ,(intern (format "eieio--%s-num-slots" prefix)) ,index))))
 
 (eieio--define-field-accessors class
-  (-unused-0 ;;FIXME: not sure, but at least there was no accessor!
+  (-unused-0 ;;Constant slot, set to `defclass'.
    (symbol "symbol (self-referencing)")
    parent children
-   (symbol-obarray "obarray permitting fast access to variable position 
indexes")
+   (symbol-hashtable "hashtable permitting fast access to variable position 
indexes")
    ;; @todo
    ;; the word "public" here is leftovers from the very first version.
    ;; Get rid of it!
@@ -166,26 +166,34 @@ from the default.")
 Stored outright without modifications or stripping.")))
 
 (eieio--define-field-accessors object
-  (-unused-0 ;;FIXME: not sure, but at least there was no accessor!
-   (class "class struct defining OBJ")
-   name))
+  ;; `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 "tag containing the class struct")))
 
-;; FIXME: The constants below should have an `eieio-' prefix added!!
+(defsubst eieio--object-class-object (obj)
+  (symbol-value (eieio--object-class-tag obj)))
+
+(defsubst eieio--object-class-name (obj)
+  ;; FIXME: Most uses of this function should be changed to use
+  ;; eieio--object-class-object instead!
+  (eieio--class-symbol (eieio--object-class-object obj)))
 
-(defconst method-static 0 "Index into :static tag on a method.")
-(defconst method-before 1 "Index into :before tag on a method.")
-(defconst method-primary 2 "Index into :primary tag on a method.")
-(defconst method-after 3 "Index into :after tag on a method.")
-(defconst method-num-lists 4 "Number of indexes into methods vector in which 
groups of functions are kept.")
-(defconst method-generic-before 4 "Index into generic :before tag on a 
method.")
-(defconst method-generic-primary 5 "Index into generic :primary tag on a 
method.")
-(defconst method-generic-after 6 "Index into generic :after tag on a method.")
-(defconst method-num-slots 7 "Number of indexes into a method's vector.")
+;; FIXME: The constants below should have an `eieio-' prefix added!!
+(defconst eieio--method-static 0 "Index into :static tag on a method.")
+(defconst eieio--method-before 1 "Index into :before tag on a method.")
+(defconst eieio--method-primary 2 "Index into :primary tag on a method.")
+(defconst eieio--method-after 3 "Index into :after tag on a method.")
+(defconst eieio--method-num-lists 4 "Number of indexes into methods vector in 
which groups of functions are kept.")
+(defconst eieio--method-generic-before 4 "Index into generic :before tag on a 
method.")
+(defconst eieio--method-generic-primary 5 "Index into generic :primary tag on 
a method.")
+(defconst eieio--method-generic-after 6 "Index into generic :after tag on a 
method.")
+(defconst eieio--method-num-slots 7 "Number of indexes into a method's 
vector.")
 
 (defsubst eieio-specialized-key-to-generic-key (key)
   "Convert a specialized KEY into a generic method key."
-  (cond ((eq key method-static) 0) ;; don't convert
-       ((< key method-num-lists) (+ key 3)) ;; The conversion
+  (cond ((eq key eieio--method-static) 0) ;; don't convert
+       ((< key eieio--method-num-lists) (+ key 3)) ;; The conversion
        (t key) ;; already generic.. maybe.
        ))
 
@@ -201,21 +209,35 @@ Stored outright without modifications or stripping.")))
               (t `(,type ,obj))))
        (signal 'wrong-type-argument (list ',type ,obj))))
 
-(defmacro class-v (class)
+(defmacro eieio--class-v (class)        ;Use a macro, so it acts as a GV place.
   "Internal: Return the class vector from the CLASS symbol."
+  (declare (debug t))
   ;; No check: If eieio gets this far, it has probably been checked already.
   `(get ,class 'eieio-class-definition))
 
+(defsubst eieio--class-object (class)
+  "Return the class object."
+  (if (symbolp class) (eieio--class-v class) class))
+
+(defsubst eieio--class-p (class)
+  "Return non-nil if CLASS is a valid class object."
+  (condition-case nil
+      (eq (aref class 0) 'defclass)
+    (error nil)))
+
 (defsubst class-p (class)
   "Return non-nil if CLASS is a valid class vector.
-CLASS is a symbol."
+CLASS is a symbol."                     ;FIXME: Is it a vector or a symbol?
   ;; this new method is faster since it doesn't waste time checking lots of
   ;; things.
   (condition-case nil
-      (eq (aref (class-v class) 0) 'defclass)
+      (eq (aref (eieio--class-v class) 0) 'defclass)
     (error nil)))
 
-(defun eieio-class-name (class) "Return a Lisp like symbol name for CLASS."
+(defun eieio-class-name (class)
+  "Return a Lisp like symbol name for CLASS."
+  ;; FIXME: What's a "Lisp like symbol name"?
+  ;; FIXME: CLOS returns a symbol, but the code returns a string.
   (eieio--check-type class-p class)
   ;; I think this is supposed to return a symbol, but to me CLASS is a symbol,
   ;; and I wanted a string.  Arg!
@@ -224,56 +246,58 @@ CLASS is a symbol."
 
 (defmacro eieio-class-parents-fast (class)
   "Return parent classes to CLASS with no check."
-  `(eieio--class-parent (class-v ,class)))
+  `(eieio--class-parent (eieio--class-v ,class)))
 
 (defmacro eieio-class-children-fast (class) "Return child classes to CLASS 
with no check."
-  `(eieio--class-children (class-v ,class)))
+  `(eieio--class-children (eieio--class-v ,class)))
 
-(defmacro same-class-fast-p (obj class)
-  "Return t if OBJ is of class-type CLASS with no error checking."
-  `(eq (eieio--object-class ,obj) ,class))
+(defsubst same-class-fast-p (obj class-name)
+  "Return t if OBJ is of class-type CLASS-NAME with no error checking."
+  ;; (eq (eieio--object-class-name obj) class)
+  (eq (eieio--object-class-object obj) (eieio--class-object class-name)))
 
 (defmacro class-constructor (class)
   "Return the symbol representing the constructor of CLASS."
-  `(eieio--class-symbol (class-v ,class)))
+  (declare (debug t))
+  `(eieio--class-symbol (eieio--class-v ,class)))
 
 (defsubst generic-p (method)
   "Return non-nil if symbol METHOD is a generic function.
-Only methods have the symbol `eieio-method-obarray' as a property
+Only methods have the symbol `eieio-method-hashtable' as a property
 \(which contains a list of all bindings to that method type.)"
-  (and (fboundp method) (get method 'eieio-method-obarray)))
+  (and (fboundp method) (get method 'eieio-method-hashtable)))
 
 (defun generic-primary-only-p (method)
   "Return t if symbol METHOD is a generic function with only primary methods.
-Only methods have the symbol `eieio-method-obarray' as a property (which
+Only methods have the symbol `eieio-method-hashtable' as a property (which
 contains a list of all bindings to that method type.)
 Methods with only primary implementations are executed in an optimized way."
   (and (generic-p method)
        (let ((M (get method 'eieio-method-tree)))
-        (and (< 0 (length (aref M method-primary)))
-             (not (aref M method-static))
-             (not (aref M method-before))
-             (not (aref M method-after))
-             (not (aref M method-generic-before))
-             (not (aref M method-generic-primary))
-             (not (aref M method-generic-after))))
-       ))
+        (not (or (>= 0 (length (aref M eieio--method-primary)))
+                  (aref M eieio--method-static)
+                  (aref M eieio--method-before)
+                  (aref M eieio--method-after)
+                  (aref M eieio--method-generic-before)
+                  (aref M eieio--method-generic-primary)
+                  (aref M eieio--method-generic-after)))
+         )))
 
 (defun generic-primary-only-one-p (method)
   "Return t if symbol METHOD is a generic function with only primary methods.
-Only methods have the symbol `eieio-method-obarray' as a property (which
+Only methods have the symbol `eieio-method-hashtable' as a property (which
 contains a list of all bindings to that method type.)
 Methods with only primary implementations are executed in an optimized way."
   (and (generic-p method)
        (let ((M (get method 'eieio-method-tree)))
-        (and (= 1 (length (aref M method-primary)))
-             (not (aref M method-static))
-             (not (aref M method-before))
-             (not (aref M method-after))
-             (not (aref M method-generic-before))
-             (not (aref M method-generic-primary))
-             (not (aref M method-generic-after))))
-       ))
+        (not (or (/= 1 (length (aref M eieio--method-primary)))
+                  (aref M eieio--method-static)
+                  (aref M eieio--method-before)
+                  (aref M eieio--method-after)
+                  (aref M eieio--method-generic-before)
+                  (aref M eieio--method-generic-primary)
+                  (aref M eieio--method-generic-after)))
+         )))
 
 (defmacro class-option-assoc (list option)
   "Return from LIST the found OPTION, or nil if it doesn't exist."
@@ -282,14 +306,15 @@ Methods with only primary implementations are executed in 
an optimized way."
 (defmacro class-option (class option)
   "Return the value stored for CLASS' OPTION.
 Return nil if that option doesn't exist."
-  `(class-option-assoc (eieio--class-options (class-v ,class)) ',option))
+  `(class-option-assoc (eieio--class-options (eieio--class-v ,class)) 
',option))
 
 (defsubst eieio-object-p (obj)
   "Return non-nil if OBJ is an EIEIO object."
-  (condition-case nil
-      (and (eq (aref obj 0) 'object)
-           (class-p (eieio--object-class obj)))
-    (error nil)))
+  (and (arrayp obj)
+       (condition-case nil
+           (eq (aref (eieio--object-class-object obj) 0) 'defclass)
+         (error nil))))
+
 (defalias 'object-p 'eieio-object-p)
 
 (defsubst class-abstract-p (class)
@@ -308,7 +333,7 @@ Abstract classes cannot be instantiated."
 ;;;
 ;; Class Creation
 
-(defvar eieio-defclass-autoload-map (make-vector 7 nil)
+(defvar eieio-defclass-autoload-map (make-hash-table)
   "Symbol map of superclasses we find in autoloads.")
 
 ;; We autoload this because it's used in `make-autoload'.
@@ -322,7 +347,7 @@ SUPERCLASSES as children.
 It creates an autoload function for CNAME's constructor."
   ;; Assume we've already debugged inputs.
 
-  (let* ((oldc (when (class-p cname) (class-v cname)))
+  (let* ((oldc (when (class-p cname) (eieio--class-v cname)))
         (newc (make-vector eieio--class-num-slots nil))
         )
     (if oldc
@@ -348,25 +373,14 @@ It creates an autoload function for CNAME's constructor."
          ;;        map needs to be cleared!
 
 
-         ;; Does our parent exist?
-         (if (not (class-p SC))
-
-             ;; Create a symbol for this parent, and then store this
-             ;; parent on that symbol.
-             (let ((sym (intern (symbol-name SC) eieio-defclass-autoload-map)))
-               (if (not (boundp sym))
-                   (set sym (list cname))
-                 (add-to-list sym cname))
-               )
+          ;; Save the child in the parent.
+          (cl-pushnew cname (if (class-p SC)
+                                (eieio--class-children (eieio--class-v SC))
+                              ;; Parent doesn't exist yet.
+                              (gethash SC eieio-defclass-autoload-map)))
 
-           ;; We have a parent, save the child in there.
-           (when (not (member cname (eieio--class-children (class-v SC))))
-             (setf (eieio--class-children (class-v SC))
-                   (cons cname (eieio--class-children (class-v SC))))))
-
-         ;; save parent in child
-         (setf (eieio--class-parent newc) (cons SC (eieio--class-parent newc)))
-         )
+         ;; Save parent in child.
+          (push SC (eieio--class-parent newc)))
 
        ;; turn this into a usable self-pointing symbol
        (set cname cname)
@@ -375,7 +389,7 @@ It creates an autoload function for CNAME's constructor."
        ;; do this first so that we can call defmethod for the accessor.
        ;; The vector will be updated by the following while loop and will not
        ;; need to be stored a second time.
-       (put cname 'eieio-class-definition newc)
+       (setf (eieio--class-v cname) newc)
 
        ;; Clear the parent
        (if clear-parent (setf (eieio--class-parent newc) nil))
@@ -390,8 +404,7 @@ It creates an autoload function for CNAME's constructor."
 
 (defsubst eieio-class-un-autoload (cname)
   "If class CNAME is in an autoload state, load its file."
-  (when (eq (car-safe (symbol-function cname)) 'autoload)
-    (load-library (car (cdr (symbol-function cname))))))
+  (autoload-do-load (symbol-function cname))) ; cname
 
 (cl-deftype list-of (elem-type)
   `(and list
@@ -415,7 +428,7 @@ See `defclass' for more information."
 
   (let* ((pname superclasses)
         (newc (make-vector eieio--class-num-slots nil))
-        (oldc (when (class-p cname) (class-v cname)))
+        (oldc (when (class-p cname) (eieio--class-v cname)))
         (groups nil) ;; list of groups id'd from slots
         (options nil)
         (clearparent nil))
@@ -430,16 +443,13 @@ See `defclass' for more information."
     ;; byte compiling an EIEIO file.
     (if oldc
        (setf (eieio--class-children newc) (eieio--class-children oldc))
-      ;; If the old class did not exist, but did exist in the autoload map, 
then adopt those children.
-      ;; This is like the above, but deals with autoloads nicely.
-      (let ((sym (intern-soft (symbol-name cname) 
eieio-defclass-autoload-map)))
-       (when sym
-         (condition-case nil
-             (setf (eieio--class-children newc) (symbol-value sym))
-           (error nil))
-         (unintern (symbol-name cname) eieio-defclass-autoload-map)
-         ))
-      )
+      ;; If the old class did not exist, but did exist in the autoload map,
+      ;; then adopt those children.  This is like the above, but deals with
+      ;; autoloads nicely.
+      (let ((children (gethash cname eieio-defclass-autoload-map)))
+       (when children
+          (setf (eieio--class-children newc) children)
+         (remhash cname eieio-defclass-autoload-map))))
 
     (cond ((and (stringp (car options-and-doc))
                (/= 1 (% (length options-and-doc) 2)))
@@ -456,39 +466,35 @@ See `defclass' for more information."
 
     (if pname
        (progn
-         (while pname
-           (if (and (car pname) (symbolp (car pname)))
-               (if (not (class-p (car pname)))
+         (dolist (p pname)
+           (if (and p (symbolp p))
+               (if (not (class-p p))
                    ;; bad class
-                   (error "Given parent class %s is not a class" (car pname))
+                   (error "Given parent class %S is not a class" p)
                  ;; good parent class...
                  ;; save new child in parent
-                 (when (not (member cname (eieio--class-children (class-v (car 
pname)))))
-                   (setf (eieio--class-children (class-v (car pname)))
-                         (cons cname (eieio--class-children (class-v (car 
pname))))))
+                  (cl-pushnew cname (eieio--class-children (eieio--class-v p)))
                  ;; Get custom groups, and store them into our local copy.
                  (mapc (lambda (g) (cl-pushnew g groups :test #'equal))
-                       (class-option (car pname) :custom-groups))
+                       (class-option p :custom-groups))
                  ;; save parent in child
-                 (setf (eieio--class-parent newc) (cons (car pname) 
(eieio--class-parent newc))))
-             (error "Invalid parent class %s" pname))
-           (setq pname (cdr pname)))
+                  (push p (eieio--class-parent newc)))
+             (error "Invalid parent class %S" p)))
          ;; Reverse the list of our parents so that they are prioritized in
          ;; the same order as specified in the code.
-         (setf (eieio--class-parent newc) (nreverse (eieio--class-parent 
newc))) )
+         (cl-callf nreverse (eieio--class-parent newc)))
       ;; If there is nothing to loop over, then inherit from the
       ;; default superclass.
       (unless (eq cname 'eieio-default-superclass)
        ;; adopt the default parent here, but clear it later...
        (setq clearparent t)
        ;; save new child in parent
-       (if (not (member cname (eieio--class-children (class-v 
'eieio-default-superclass))))
-           (setf (eieio--class-children (class-v 'eieio-default-superclass))
-                 (cons cname (eieio--class-children (class-v 
'eieio-default-superclass)))))
+        (cl-pushnew cname (eieio--class-children
+                           (eieio--class-v 'eieio-default-superclass)))
        ;; save parent in child
-       (setf (eieio--class-parent newc) (list eieio-default-superclass))))
+       (setf (eieio--class-parent newc) '(eieio-default-superclass))))
 
-    ;; turn this into a usable self-pointing symbol
+    ;; turn this into a usable self-pointing symbol;  FIXME: Why?
     (set cname cname)
 
     ;; These two tests must be created right away so we can have self-
@@ -498,10 +504,10 @@ See `defclass' for more information."
     ;; Create the test function
     (let ((csym (intern (concat (symbol-name cname) "-p"))))
       (fset csym
-           (list 'lambda (list 'obj)
-                 (format "Test OBJ to see if it an object of type %s" cname)
-                 (list 'and '(eieio-object-p obj)
-                       (list 'same-class-p 'obj cname)))))
+           `(lambda (obj)
+               ,(format "Test OBJ to see if it an object of type %s" cname)
+               (and (eieio-object-p obj)
+                    (same-class-p obj ',cname)))))
 
     ;; Make sure the method invocation order  is a valid value.
     (let ((io (class-option-assoc options :method-invocation-order)))
@@ -514,27 +520,10 @@ See `defclass' for more information."
       (fset csym
            `(lambda (obj)
               ,(format
-                 "Test OBJ to see if it an object is a child of type %s"
-                 cname)
+                 "Test OBJ to see if it an object is a child of type %s"
+                 cname)
               (and (eieio-object-p obj)
-                   (object-of-class-p obj ,cname))))
-
-    ;; Create a handy list of the class test too
-    (let ((csym (intern (concat (symbol-name cname) "-list-p"))))
-      (fset csym
-           `(lambda (obj)
-              ,(format
-                 "Test OBJ to see if it a list of objects which are a child of 
type %s"
-                 cname)
-              (when (listp obj)
-                (let ((ans t)) ;; nil is valid
-                  ;; Loop over all the elements of the input list, test
-                  ;; each to make sure it is a child of the desired object 
class.
-                  (while (and obj ans)
-                    (setq ans (and (eieio-object-p (car obj))
-                                   (object-of-class-p (car obj) ,cname)))
-                    (setq obj (cdr obj)))
-                  ans)))))
+                   (object-of-class-p obj ',cname))))
 
       ;; When using typep, (typep OBJ 'myclass) returns t for objects which
       ;; are subclasses of myclass.  For our predicates, however, it is
@@ -544,9 +533,24 @@ See `defclass' for more information."
       ;; test, so we can let typep have the CLOS documented behavior
       ;; while keeping our above predicate clean.
 
-      ;; FIXME: It would be cleaner to use `cl-deftype' here.
-      (put cname 'cl-deftype-handler
-          (list 'lambda () `(list 'satisfies (quote ,csym)))))
+      (put cname 'cl-deftype-satisfies csym))
+
+    ;; Create a handy list of the class test too
+    (let ((csym (intern (concat (symbol-name cname) "-list-p"))))
+      (fset csym
+            `(lambda (obj)
+               ,(format
+                 "Test OBJ to see if it a list of objects which are a child of 
type %s"
+                 cname)
+               (when (listp obj)
+                 (let ((ans t)) ;; nil is valid
+                   ;; Loop over all the elements of the input list, test
+                   ;; each to make sure it is a child of the desired object 
class.
+                   (while (and obj ans)
+                     (setq ans (and (eieio-object-p (car obj))
+                                    (object-of-class-p (car obj) ,cname)))
+                     (setq obj (cdr obj)))
+                   ans)))))
 
     ;; Before adding new slots, let's add all the methods and classes
     ;; in from the parent class.
@@ -556,7 +560,7 @@ See `defclass' for more information."
     ;; do this first so that we can call defmethod for the accessor.
     ;; The vector will be updated by the following while loop and will not
     ;; need to be stored a second time.
-    (put cname 'eieio-class-definition newc)
+    (setf (eieio--class-v cname) newc)
 
     ;; Query each slot in the declaration list and mangle into the
     ;; class structure I have defined.
@@ -666,6 +670,9 @@ See `defclass' for more information."
               ;; FIXME: We should move more of eieio-defclass into the
               ;; defclass macro so we don't have to use `eval' and require
               ;; `gv' at run-time.
+              ;; FIXME: The defmethod above only defines a part of the generic
+              ;; function, but the define-setter below affects the whole
+              ;; generic function!
               (eval `(gv-define-setter ,acces (eieio--store eieio--object)
                        (list 'eieio-oset eieio--object '',name
                              eieio--store)))))
@@ -693,52 +700,41 @@ See `defclass' for more information."
 
     ;; Now that everything has been loaded up, all our lists are backwards!
     ;; Fix that up now.
-    (setf (eieio--class-public-a newc) (nreverse (eieio--class-public-a newc)))
-    (setf (eieio--class-public-d newc) (nreverse (eieio--class-public-d newc)))
-    (setf (eieio--class-public-doc newc) (nreverse (eieio--class-public-doc 
newc)))
-    (setf (eieio--class-public-type newc)
-         (apply #'vector (nreverse (eieio--class-public-type newc))))
-    (setf (eieio--class-public-custom newc) (nreverse 
(eieio--class-public-custom newc)))
-    (setf (eieio--class-public-custom-label newc) (nreverse 
(eieio--class-public-custom-label newc)))
-    (setf (eieio--class-public-custom-group newc) (nreverse 
(eieio--class-public-custom-group newc)))
-    (setf (eieio--class-public-printer newc) (nreverse 
(eieio--class-public-printer newc)))
-    (setf (eieio--class-protection newc) (nreverse (eieio--class-protection 
newc)))
-    (setf (eieio--class-initarg-tuples newc) (nreverse 
(eieio--class-initarg-tuples newc)))
+    (cl-callf nreverse (eieio--class-public-a newc))
+    (cl-callf nreverse (eieio--class-public-d newc))
+    (cl-callf nreverse (eieio--class-public-doc newc))
+    (cl-callf (lambda (types) (apply #'vector (nreverse types)))
+        (eieio--class-public-type newc))
+    (cl-callf nreverse (eieio--class-public-custom newc))
+    (cl-callf nreverse (eieio--class-public-custom-label newc))
+    (cl-callf nreverse (eieio--class-public-custom-group newc))
+    (cl-callf nreverse (eieio--class-public-printer newc))
+    (cl-callf nreverse (eieio--class-protection newc))
+    (cl-callf nreverse (eieio--class-initarg-tuples newc))
 
     ;; The storage for class-class-allocation-type needs to be turned into
     ;; a vector now.
-    (setf (eieio--class-class-allocation-type newc)
-         (apply #'vector (eieio--class-class-allocation-type newc)))
+    (cl-callf (lambda (cat) (apply #'vector cat))
+        (eieio--class-class-allocation-type newc))
 
     ;; Also, take class allocated values, and vectorize them for speed.
-    (setf (eieio--class-class-allocation-values newc)
-         (apply #'vector (eieio--class-class-allocation-values newc)))
-
-    ;; Attach slot symbols into an obarray, and store the index of
-    ;; this slot as the variable slot in this new symbol.  We need to
-    ;; know about primes, because obarrays are best set in vectors of
-    ;; prime number length, and we also need to make our vector small
-    ;; to save space, and also optimal for the number of items we have.
+    (cl-callf (lambda (cavs) (apply #'vector cavs))
+        (eieio--class-class-allocation-values newc))
+
+    ;; Attach slot symbols into a hashtable, and store the index of
+    ;; this slot as the value this table.
     (let* ((cnt 0)
           (pubsyms (eieio--class-public-a newc))
           (prots (eieio--class-protection newc))
-          (l (length pubsyms))
-          (vl (let ((primes '( 3 5 7 11 13 17 19 23 29 31 37 41 43 47
-                                 53 59 61 67 71 73 79 83 89 97 101 )))
-                (while (and primes (< (car primes) l))
-                  (setq primes (cdr primes)))
-                (car primes)))
-          (oa (make-vector vl 0))
-          (newsym))
+          (oa (make-hash-table :test #'eq)))
       (while pubsyms
-       (setq newsym (intern (symbol-name (car pubsyms)) oa))
-       (set newsym cnt)
-       (setq cnt (1+ cnt))
-       (if (car prots) (put newsym 'protection (car prots)))
+       (let ((newsym (list cnt)))
+          (setf (gethash (car pubsyms) oa) newsym)
+          (setq cnt (1+ cnt))
+          (if (car prots) (setcdr newsym (car prots))))
        (setq pubsyms (cdr pubsyms)
              prots (cdr prots)))
-      (setf (eieio--class-symbol-obarray newc) oa)
-      )
+      (setf (eieio--class-symbol-hashtable newc) oa))
 
     ;; Create the constructor function
     (if (class-option-assoc options :abstract)
@@ -753,9 +749,14 @@ See `defclass' for more information."
 
       ;; Non-abstract classes need a constructor.
       (fset cname
-           `(lambda (newname &rest slots)
+           `(lambda (&rest slots)
               ,(format "Create a new object with name NAME of class type %s" 
cname)
-              (apply #'constructor ,cname newname slots)))
+               (if (and slots
+                        (let ((x (car slots)))
+                          (or (stringp x) (null x))))
+                   (message "Obsolete name %S passed to %S constructor"
+                            (pop slots) ',cname))
+              (apply #'eieio-constructor ',cname slots)))
       )
 
     ;; Set up a specialized doc string.
@@ -787,11 +788,17 @@ See `defclass' for more information."
     (if clearparent (setf (eieio--class-parent newc) nil))
 
     ;; Create the cached default object.
-    (let ((cache (make-vector (+ (length (eieio--class-public-a newc)) 3)
-                              nil)))
-      (aset cache 0 'object)
-      (setf (eieio--object-class cache) cname)
-      (setf (eieio--object-name cache) 'default-cache-object)
+    (let ((cache (make-vector (+ (length (eieio--class-public-a newc))
+                                 (eval-when-compile eieio--object-num-slots))
+                              nil))
+          ;; We don't strictly speaking need to use a symbol, but the old
+          ;; code used the class's name rather than the class's object, so
+          ;; we follow this preference for using a symbol, which is probably
+          ;; convenient to keep the printed representation of such Elisp
+          ;; objects readable.
+          (tag (intern (format "eieio-class-tag--%s" cname))))
+      (set tag newc)
+      (setf (eieio--object-class-tag cache) tag)
       (let ((eieio-skip-typecheck t))
        ;; All type-checking has been done to our satisfaction
        ;; before this call.  Don't waste our time in this call..
@@ -1050,7 +1057,7 @@ the new child class."
                                ':allow-nil-initform)))
     (while ps
       ;; First, duplicate all the slots of the parent.
-      (let ((pcv (class-v (car ps))))
+      (let ((pcv (eieio--class-v (car ps))))
        (let ((pa (eieio--class-public-a pcv))
              (pd (eieio--class-public-d pcv))
              (pdoc (eieio--class-public-doc pcv))
@@ -1117,126 +1124,126 @@ the new child class."
 
 (defun eieio--defgeneric-init-form (method doc-string)
   "Form to use for the initial definition of a generic."
+  (while (and (fboundp method) (symbolp (symbol-function method)))
+    ;; Follow aliases, so methods applied to obsolete aliases still work.
+    (setq method (symbol-function method)))
+
   (cond
    ((or (not (fboundp method))
         (eq 'autoload (car-safe (symbol-function method))))
     ;; Make sure the method tables are installed.
     (eieiomt-install method)
     ;; Construct the actual body of this function.
-    (eieio-defgeneric-form method doc-string))
+    (put method 'function-documentation doc-string)
+    (eieio-defgeneric-form method))
    ((generic-p method) (symbol-function method))           ;Leave it as-is.
    (t (error "You cannot create a generic/method over an existing symbol: %s"
              method))))
 
-(defun eieio-defgeneric-form (method doc-string)
+(defun eieio-defgeneric-form (method)
   "The lambda form that would be used as the function defined on METHOD.
 All methods should call the same EIEIO function for dispatch.
 DOC-STRING is the documentation attached to METHOD."
-  `(lambda (&rest local-args)
-     ,doc-string
-     (eieio-generic-call (quote ,method) local-args)))
+  (lambda (&rest local-args)
+    (eieio-generic-call method local-args)))
 
 (defsubst eieio-defgeneric-reset-generic-form (method)
   "Setup METHOD to call the generic form."
-  (let ((doc-string (documentation method)))
-    (fset method (eieio-defgeneric-form method doc-string))))
+  (let ((doc-string (documentation method 'raw)))
+    (put method 'function-documentation doc-string)
+    (fset method (eieio-defgeneric-form method))))
 
-(defun eieio-defgeneric-form-primary-only (method doc-string)
+(defun eieio-defgeneric-form-primary-only (method)
   "The lambda form that would be used as the function defined on METHOD.
 All methods should call the same EIEIO function for dispatch.
 DOC-STRING is the documentation attached to METHOD."
-  `(lambda (&rest local-args)
-     ,doc-string
-     (eieio-generic-call-primary-only (quote ,method) local-args)))
+  (lambda (&rest local-args)
+    (eieio-generic-call-primary-only method local-args)))
 
 (defsubst eieio-defgeneric-reset-generic-form-primary-only (method)
   "Setup METHOD to call the generic form."
-  (let ((doc-string (documentation method)))
-    (fset method (eieio-defgeneric-form-primary-only method doc-string))))
+  (let ((doc-string (documentation method 'raw)))
+    (put method 'function-documentation doc-string)
+    (fset method (eieio-defgeneric-form-primary-only method))))
 
 (declare-function no-applicable-method "eieio" (object method &rest args))
 
-(defun eieio-defgeneric-form-primary-only-one (method doc-string
-                                                     class
-                                                     impl
-                                                     )
+(defvar eieio-generic-call-arglst nil
+  "When using `call-next-method', provides a context for parameters.")
+(defvar eieio-generic-call-key nil
+  "When using `call-next-method', provides a context for the current key.
+Keys are a number representing :before, :primary, and :after methods.")
+(defvar eieio-generic-call-next-method-list nil
+  "When executing a PRIMARY or STATIC method, track the 'next-method'.
+During executions, the list is first generated, then as each next method
+is called, the next method is popped off the stack.")
+
+(defun eieio-defgeneric-form-primary-only-one (method class impl)
   "The lambda form that would be used as the function defined on METHOD.
 All methods should call the same EIEIO function for dispatch.
-DOC-STRING is the documentation attached to METHOD.
 CLASS is the class symbol needed for private method access.
 IMPL is the symbol holding the method implementation."
-  ;; NOTE: I tried out byte compiling this little fcn.  Turns out it
-  ;; is faster to execute this for not byte-compiled.  ie, install this,
-  ;; then measure calls going through here.  I wonder why.
-  (require 'bytecomp)
-  (let ((byte-compile-warnings nil))
-    (byte-compile
-     `(lambda (&rest local-args)
-       ,doc-string
-       ;; This is a cool cheat.  Usually we need to look up in the
-       ;; method table to find out if there is a method or not.  We can
-       ;; instead make that determination at load time when there is
-       ;; only one method.  If the first arg is not a child of the class
-       ;; of that one implementation, then clearly, there is no method def.
-       (if (not (eieio-object-p (car local-args)))
-           ;; Not an object.  Just signal.
-           (signal 'no-method-definition
-                    (list ',method local-args))
-
-         ;; We do have an object.  Make sure it is the right type.
-         (if ,(if (eq class eieio-default-superclass)
-                  nil  ; default superclass means just an obj.  Already asked.
-                `(not (child-of-class-p (eieio--object-class (car local-args))
-                                        ',class)))
-
-             ;; If not the right kind of object, call no applicable
-             (apply #'no-applicable-method (car local-args)
-                    ',method local-args)
-
-           ;; It is ok, do the call.
-           ;; Fill in inter-call variables then evaluate the method.
-           (let ((eieio-generic-call-next-method-list nil)
-                 (eieio-generic-call-key method-primary)
-                 (eieio-generic-call-methodname ',method)
-                 (eieio-generic-call-arglst local-args)
-                 )
-             (eieio--with-scoped-class ',class
-               ,(if (< emacs-major-version 24)
-                    `(apply ,(list 'quote impl) local-args)
-                  `(apply #',impl local-args)))
-             ;(,impl local-args)
-             )))))))
+  (lambda (&rest local-args)
+    ;; This is a cool cheat.  Usually we need to look up in the
+    ;; method table to find out if there is a method or not.  We can
+    ;; instead make that determination at load time when there is
+    ;; only one method.  If the first arg is not a child of the class
+    ;; of that one implementation, then clearly, there is no method def.
+    (if (not (eieio-object-p (car local-args)))
+        ;; Not an object.  Just signal.
+        (signal 'no-method-definition
+                (list method local-args))
+
+      ;; We do have an object.  Make sure it is the right type.
+      (if (not (child-of-class-p (eieio--object-class-object (car local-args))
+                                 class))
+
+          ;; If not the right kind of object, call no applicable
+          (apply #'no-applicable-method (car local-args)
+                 method local-args)
+
+        ;; It is ok, do the call.
+        ;; Fill in inter-call variables then evaluate the method.
+        (let ((eieio-generic-call-next-method-list nil)
+              (eieio-generic-call-key eieio--method-primary)
+              (eieio-generic-call-arglst local-args)
+              )
+          (eieio--with-scoped-class (eieio--class-v class)
+            (apply impl local-args)))))))
 
 (defsubst eieio-defgeneric-reset-generic-form-primary-only-one (method)
   "Setup METHOD to call the generic form."
-  (let* ((doc-string (documentation method))
+  (let* ((doc-string (documentation method 'raw))
         (M (get method 'eieio-method-tree))
-        (entry (car (aref M method-primary)))
+        (entry (car (aref M eieio--method-primary)))
         )
+    (put method 'function-documentation doc-string)
     (fset method (eieio-defgeneric-form-primary-only-one
-                 method doc-string
-                 (car entry)
-                 (cdr entry)
-                 ))))
+                 method (car entry) (cdr entry)))))
 
 (defun eieio-unbind-method-implementations (method)
   "Make the generic method METHOD have no implementations.
 It will leave the original generic function in place,
 but remove reference to all implementations of METHOD."
   (put method 'eieio-method-tree nil)
-  (put method 'eieio-method-obarray nil))
+  (put method 'eieio-method-hashtable nil))
 
 (defun eieio--defmethod (method kind argclass code)
   "Work part of the `defmethod' macro defining METHOD with ARGS."
   (let ((key
          ;; Find optional keys.
-         (cond ((memq kind '(:BEFORE :before)) method-before)
-               ((memq kind '(:AFTER :after)) method-after)
-               ((memq kind '(:STATIC :static)) method-static)
-               ((memq kind '(:PRIMARY :primary nil)) method-primary)
+         (cond ((memq kind '(:BEFORE :before)) eieio--method-before)
+               ((memq kind '(:AFTER :after)) eieio--method-after)
+               ((memq kind '(:STATIC :static)) eieio--method-static)
+               ((memq kind '(:PRIMARY :primary nil)) eieio--method-primary)
                ;; Primary key.
-               ;; (t method-primary)
+               ;; (t eieio--method-primary)
                (t (error "Unknown method kind %S" kind)))))
+
+    (while (and (fboundp method) (symbolp (symbol-function method)))
+      ;; Follow aliases, so methods applied to obsolete aliases still work.
+      (setq method (symbol-function method)))
+
     ;; Make sure there is a generic (when called from defclass).
     (eieio--defalias
      method (eieio--defgeneric-init-form
@@ -1248,7 +1255,7 @@ but remove reference to all implementations of METHOD."
     ;; under the type `primary' which is a non-specific calling of the
     ;; function.
     (if argclass
-        (if (not (class-p argclass))
+        (if (not (class-p argclass))    ;FIXME: Accept cl-defstructs!
             (error "Unknown class type %s in method parameters"
                    argclass))
       ;; Generics are higher.
@@ -1292,8 +1299,8 @@ an error."
   (if eieio-skip-typecheck
       nil
     ;; Trim off object IDX junk added in for the object index.
-    (setq slot-idx (- slot-idx 3))
-    (let ((st (aref (eieio--class-public-type (class-v class)) slot-idx)))
+    (setq slot-idx (- slot-idx (eval-when-compile eieio--object-num-slots)))
+    (let ((st (aref (eieio--class-public-type (eieio--class-v class)) 
slot-idx)))
       (if (not (eieio-perform-slot-validation st value))
          (signal 'invalid-slot-type (list class slot st value))))))
 
@@ -1304,7 +1311,7 @@ SLOT is the slot that is being checked, and is only used 
when throwing
 an error."
   (if eieio-skip-typecheck
       nil
-    (let ((st (aref (eieio--class-class-allocation-type (class-v class))
+    (let ((st (aref (eieio--class-class-allocation-type (eieio--class-v class))
                    slot-idx)))
       (if (not (eieio-perform-slot-validation st value))
          (signal 'invalid-slot-type (list class slot st value))))))
@@ -1315,7 +1322,7 @@ INSTANCE is the object being referenced.  SLOTNAME is the 
offending
 slot.  If the slot is ok, return VALUE.
 Argument FN is the function calling this verifier."
   (if (and (eq value eieio-unbound) (not eieio-skip-typecheck))
-      (slot-unbound instance (eieio--object-class instance) slotname fn)
+      (slot-unbound instance (eieio--object-class-name instance) slotname fn)
     value))
 
 
@@ -1326,14 +1333,14 @@ Argument FN is the function calling this verifier."
   (eieio--check-type (or eieio-object-p class-p) obj)
   (eieio--check-type symbolp slot)
   (if (class-p obj) (eieio-class-un-autoload obj))
-  (let* ((class (if (class-p obj) obj (eieio--object-class obj)))
-        (c (eieio-slot-name-index class obj slot)))
+  (let* ((class (if (class-p obj) obj (eieio--object-class-name obj)))
+        (c (eieio--slot-name-index (eieio--class-v class) obj slot)))
     (if (not c)
        ;; It might be missing because it is a :class allocated slot.
        ;; Let's check that info out.
        (if (setq c (eieio-class-slot-name-index class slot))
            ;; Oref that slot.
-           (aref (eieio--class-class-allocation-values (class-v class)) c)
+           (aref (eieio--class-class-allocation-values (eieio--class-v class)) 
c)
          ;; The slot-missing method is a cool way of allowing an object author
          ;; to intercept missing slot definitions.  Since it is also the LAST
          ;; thing called in this fn, its return value would be retrieved.
@@ -1349,21 +1356,22 @@ Argument FN is the function calling this verifier."
 Fills in OBJ's SLOT with its default value."
   (eieio--check-type (or eieio-object-p class-p) obj)
   (eieio--check-type symbolp slot)
-  (let* ((cl (if (eieio-object-p obj) (eieio--object-class obj) obj))
-        (c (eieio-slot-name-index cl obj slot)))
+  (let* ((cl (if (eieio-object-p obj) (eieio--object-class-name obj) obj))
+        (c (eieio--slot-name-index (eieio--class-v cl) obj slot)))
     (if (not c)
        ;; It might be missing because it is a :class allocated slot.
        ;; Let's check that info out.
        (if (setq c
                  (eieio-class-slot-name-index cl slot))
            ;; Oref that slot.
-           (aref (eieio--class-class-allocation-values (class-v cl))
+           (aref (eieio--class-class-allocation-values (eieio--class-v cl))
                  c)
          (slot-missing obj slot 'oref-default)
          ;;(signal 'invalid-slot-name (list (class-name cl) slot))
          )
       (eieio-barf-if-slot-unbound
-       (let ((val (nth (- c 3) (eieio--class-public-d (class-v cl)))))
+       (let ((val (nth (- c (eval-when-compile eieio--object-num-slots))
+                       (eieio--class-public-d (eieio--class-v cl)))))
         (eieio-default-eval-maybe val))
        obj cl 'oref-default))))
 
@@ -1384,22 +1392,24 @@ Fills in OBJ's SLOT with its default value."
 Fills in OBJ's SLOT with VALUE."
   (eieio--check-type eieio-object-p obj)
   (eieio--check-type symbolp slot)
-  (let ((c (eieio-slot-name-index (eieio--object-class obj) obj slot)))
+  (let* ((class (eieio--object-class-object obj))
+         (c (eieio--slot-name-index class obj slot)))
     (if (not c)
        ;; It might be missing because it is a :class allocated slot.
        ;; Let's check that info out.
        (if (setq c
-                 (eieio-class-slot-name-index (eieio--object-class obj) slot))
+                 (eieio-class-slot-name-index (eieio--class-symbol class) 
slot))
            ;; Oset that slot.
            (progn
-             (eieio-validate-class-slot-value (eieio--object-class obj) c 
value slot)
-             (aset (eieio--class-class-allocation-values (class-v 
(eieio--object-class obj)))
+             (eieio-validate-class-slot-value (eieio--class-symbol class)
+                                               c value slot)
+             (aset (eieio--class-class-allocation-values class)
                    c value))
          ;; See oref for comment on `slot-missing'
          (slot-missing obj slot 'oset value)
          ;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
          )
-      (eieio-validate-slot-value (eieio--object-class obj) c value slot)
+      (eieio-validate-slot-value (eieio--class-symbol class) c value slot)
       (aset obj c value))))
 
 (defun eieio-oset-default (class slot value)
@@ -1407,8 +1417,8 @@ Fills in OBJ's SLOT with VALUE."
 Fills in the default value in CLASS' in SLOT with VALUE."
   (eieio--check-type class-p class)
   (eieio--check-type symbolp slot)
-  (eieio--with-scoped-class class
-    (let* ((c (eieio-slot-name-index class nil slot)))
+  (eieio--with-scoped-class (eieio--class-v class)
+    (let* ((c (eieio--slot-name-index (eieio--class-v class) nil slot)))
       (if (not c)
          ;; It might be missing because it is a :class allocated slot.
          ;; Let's check that info out.
@@ -1416,15 +1426,16 @@ Fills in the default value in CLASS' in SLOT with 
VALUE."
              (progn
                ;; Oref that slot.
                (eieio-validate-class-slot-value class c value slot)
-               (aset (eieio--class-class-allocation-values (class-v class)) c
+               (aset (eieio--class-class-allocation-values (eieio--class-v 
class)) c
                      value))
            (signal 'invalid-slot-name (list (eieio-class-name class) slot)))
        (eieio-validate-slot-value class c value slot)
        ;; Set this into the storage for defaults.
-       (setcar (nthcdr (- c 3) (eieio--class-public-d (class-v class)))
+       (setcar (nthcdr (- c (eval-when-compile eieio--object-num-slots))
+                        (eieio--class-public-d (eieio--class-v class)))
                value)
        ;; Take the value, and put it into our cache object.
-       (eieio-oset (eieio--class-default-object-cache (class-v class))
+       (eieio-oset (eieio--class-default-object-cache (eieio--class-v class))
                    slot value)
        ))))
 
@@ -1435,18 +1446,17 @@ Fills in the default value in CLASS' in SLOT with 
VALUE."
   "Return non-nil if START-CLASS is the first class to define SLOT.
 This is for testing if the class currently in scope is the class that defines 
SLOT
 so that we can protect private slots."
-  (let ((par (eieio-class-parents-fast start-class))
+  (let ((par (eieio--class-parent start-class))
        (ret t))
     (if (not par)
        t
       (while (and par ret)
-       (if (intern-soft (symbol-name slot)
-                        (eieio--class-symbol-obarray (class-v (car par))))
+       (if (gethash slot (eieio--class-symbol-hashtable (eieio--class-v (car 
par))))
            (setq ret nil))
        (setq par (cdr par)))
       ret)))
 
-(defun eieio-slot-name-index (class obj slot)
+(defun eieio--slot-name-index (class obj slot)
   "In CLASS for OBJ find the index of the named SLOT.
 The slot is a symbol which is installed in CLASS by the `defclass'
 call.  OBJ can be nil, but if it is an object, and the slot in question
@@ -1455,27 +1465,26 @@ scoped class.
 If SLOT is the value created with :initarg instead,
 reverse-lookup that name, and recurse with the associated slot value."
   ;; Removed checks to outside this call
-  (let* ((fsym (intern-soft (symbol-name slot)
-                           (eieio--class-symbol-obarray (class-v class))))
-        (fsi (if (symbolp fsym) (symbol-value fsym) nil)))
+  (let* ((fsym (gethash slot (eieio--class-symbol-hashtable class)))
+        (fsi (car fsym)))
     (if (integerp fsi)
        (cond
-        ((not (get fsym 'protection))
-         (+ 3 fsi))
-        ((and (eq (get fsym 'protection) 'protected)
+        ((not (cdr fsym))
+         (+ (eval-when-compile eieio--object-num-slots) fsi))
+        ((and (eq (cdr fsym) 'protected)
               (eieio--scoped-class)
               (or (child-of-class-p class (eieio--scoped-class))
                   (and (eieio-object-p obj)
-                       (child-of-class-p class (eieio--object-class obj)))))
-         (+ 3 fsi))
-        ((and (eq (get fsym 'protection) 'private)
+                       (child-of-class-p class (eieio--object-class-object 
obj)))))
+         (+ (eval-when-compile eieio--object-num-slots) fsi))
+        ((and (eq (cdr fsym) 'private)
               (or (and (eieio--scoped-class)
                        (eieio-slot-originating-class-p (eieio--scoped-class) 
slot))
                   eieio-initializing-object))
-         (+ 3 fsi))
+         (+ (eval-when-compile eieio--object-num-slots) fsi))
         (t nil))
-      (let ((fn (eieio-initarg-to-attribute class slot)))
-       (if fn (eieio-slot-name-index class obj fn) nil)))))
+      (let ((fn (eieio--initarg-to-attribute class slot)))
+       (if fn (eieio--slot-name-index class obj fn) nil)))))
 
 (defun eieio-class-slot-name-index (class slot)
   "In CLASS find the index of the named SLOT.
@@ -1484,7 +1493,7 @@ call.  If SLOT is the value created with :initarg instead,
 reverse-lookup that name, and recurse with the associated slot value."
   ;; This will happen less often, and with fewer slots.  Do this the
   ;; storage cheap way.
-  (let* ((a (eieio--class-class-allocation-a (class-v class)))
+  (let* ((a (eieio--class-class-allocation-a (eieio--class-v class)))
         (l1 (length a))
         (af (memq slot a))
         (l2 (length af)))
@@ -1501,20 +1510,20 @@ reverse-lookup that name, and recurse with the 
associated slot value."
 If SET-ALL is non-nil, then when a default is nil, that value is
 reset.  If SET-ALL is nil, the slots are only reset if the default is
 not nil."
-  (eieio--with-scoped-class (eieio--object-class obj)
+  (eieio--with-scoped-class (eieio--object-class-object obj)
     (let ((eieio-initializing-object t)
-         (pub (eieio--class-public-a (class-v (eieio--object-class obj)))))
+         (pub (eieio--class-public-a (eieio--object-class-object obj))))
       (while pub
        (let ((df (eieio-oref-default obj (car pub))))
          (if (or df set-all)
              (eieio-oset obj (car pub) df)))
        (setq pub (cdr pub))))))
 
-(defun eieio-initarg-to-attribute (class initarg)
+(defun eieio--initarg-to-attribute (class initarg)
   "For CLASS, convert INITARG to the actual attribute name.
 If there is no translation, pass it in directly (so we can cheat if
 need be... May remove that later...)"
-  (let ((tuple (assoc initarg (eieio--class-initarg-tuples (class-v class)))))
+  (let ((tuple (assoc initarg (eieio--class-initarg-tuples class))))
     (if tuple
        (cdr tuple)
       nil)))
@@ -1522,7 +1531,7 @@ need be... May remove that later...)"
 (defun eieio-attribute-to-initarg (class attribute)
   "In CLASS, convert the ATTRIBUTE into the corresponding init argument tag.
 This is usually a symbol that starts with `:'."
-  (let ((tuple (rassoc attribute (eieio--class-initarg-tuples (class-v 
class)))))
+  (let ((tuple (rassoc attribute (eieio--class-initarg-tuples (eieio--class-v 
class)))))
     (if tuple
        (car tuple)
       nil)))
@@ -1651,17 +1660,6 @@ method invocation orders of the involved classes."
 
 ;;; CLOS generics internal function handling
 ;;
-(defvar eieio-generic-call-methodname nil
-  "When using `call-next-method', provides a context on how to do it.")
-(defvar eieio-generic-call-arglst nil
-  "When using `call-next-method', provides a context for parameters.")
-(defvar eieio-generic-call-key nil
-  "When using `call-next-method', provides a context for the current key.
-Keys are a number representing :before, :primary, and :after methods.")
-(defvar eieio-generic-call-next-method-list nil
-  "When executing a PRIMARY or STATIC method, track the 'next-method'.
-During executions, the list is first generated, then as each next method
-is called, the next method is popped off the stack.")
 
 (define-obsolete-variable-alias 'eieio-pre-method-execution-hooks
   'eieio-pre-method-execution-functions "24.3")
@@ -1677,7 +1675,6 @@ This should only be called from a generic function."
   ;; We must expand our arguments first as they are always
   ;; passed in as quoted symbols
   (let ((newargs nil) (mclass nil)  (lambdas nil) (tlambdas nil) (keys nil)
-       (eieio-generic-call-methodname method)
        (eieio-generic-call-arglst args)
        (firstarg nil)
        (primarymethodlist nil))
@@ -1696,7 +1693,7 @@ This should only be called from a generic function."
        (load (nth 1 (symbol-function firstarg))))
     ;; Determine the class to use.
     (cond ((eieio-object-p firstarg)
-          (setq mclass (eieio--object-class firstarg)))
+          (setq mclass (eieio--object-class-name firstarg)))
          ((class-p firstarg)
           (setq mclass firstarg))
          )
@@ -1720,34 +1717,34 @@ This should only be called from a generic function."
       ;; :after methods
       (setq tlambdas
            (if mclass
-               (eieiomt-method-list method method-after mclass)
-             (list (eieio-generic-form method method-after nil)))
-           ;;(or (and mclass (eieio-generic-form method method-after mclass))
-           ;;  (eieio-generic-form method method-after nil))
+               (eieiomt-method-list method eieio--method-after mclass)
+             (list (eieio-generic-form method eieio--method-after nil)))
+           ;;(or (and mclass (eieio-generic-form method eieio--method-after 
mclass))
+           ;;  (eieio-generic-form method eieio--method-after nil))
            )
       (setq lambdas (append tlambdas lambdas)
-           keys (append (make-list (length tlambdas) method-after) keys))
+           keys (append (make-list (length tlambdas) eieio--method-after) 
keys))
 
       ;; :primary methods
       (setq tlambdas
-           (or (and mclass (eieio-generic-form method method-primary mclass))
-               (eieio-generic-form method method-primary nil)))
+           (or (and mclass (eieio-generic-form method eieio--method-primary 
mclass))
+               (eieio-generic-form method eieio--method-primary nil)))
       (when tlambdas
        (setq lambdas (cons tlambdas lambdas)
-             keys (cons method-primary keys)
+             keys (cons eieio--method-primary keys)
              primarymethodlist
-             (eieiomt-method-list method method-primary mclass)))
+             (eieiomt-method-list method eieio--method-primary mclass)))
 
       ;; :before methods
       (setq tlambdas
            (if mclass
-               (eieiomt-method-list method method-before mclass)
-             (list (eieio-generic-form method method-before nil)))
-           ;;(or (and mclass (eieio-generic-form method method-before mclass))
-           ;;  (eieio-generic-form method method-before nil))
+               (eieiomt-method-list method eieio--method-before mclass)
+             (list (eieio-generic-form method eieio--method-before nil)))
+           ;;(or (and mclass (eieio-generic-form method eieio--method-before 
mclass))
+           ;;  (eieio-generic-form method eieio--method-before nil))
            )
       (setq lambdas (append tlambdas lambdas)
-           keys (append (make-list (length tlambdas) method-before) keys))
+           keys (append (make-list (length tlambdas) eieio--method-before) 
keys))
       )
 
     (if mclass
@@ -1755,20 +1752,20 @@ This should only be called from a generic function."
        ;; if there were no methods found, then there could be :static methods.
        (when (not lambdas)
          (setq tlambdas
-               (eieio-generic-form method method-static mclass))
+               (eieio-generic-form method eieio--method-static mclass))
          (setq lambdas (cons tlambdas lambdas)
-               keys (cons method-static keys)
+               keys (cons eieio--method-static keys)
                primarymethodlist  ;; Re-use even with bad name here
-               (eieiomt-method-list method method-static mclass)))
+               (eieiomt-method-list method eieio--method-static mclass)))
       ;; For the case of no class (ie - mclass == nil) then there may
       ;; be a primary method.
       (setq tlambdas
-           (eieio-generic-form method method-primary nil))
+           (eieio-generic-form method eieio--method-primary nil))
       (when tlambdas
        (setq lambdas (cons tlambdas lambdas)
-             keys (cons method-primary keys)
+             keys (cons eieio--method-primary keys)
              primarymethodlist
-             (eieiomt-method-list method method-primary nil)))
+             (eieiomt-method-list method eieio--method-primary nil)))
       )
 
     (run-hook-with-args 'eieio-pre-method-execution-functions
@@ -1779,11 +1776,11 @@ This should only be called from a generic function."
     (let ((rval nil) (lastval nil) (found nil))
       (while lambdas
        (if (car lambdas)
-           (eieio--with-scoped-class (cdr (car lambdas))
+           (eieio--with-scoped-class (eieio--class-v (cdr (car lambdas)))
              (let* ((eieio-generic-call-key (car keys))
                     (has-return-val
-                     (or (= eieio-generic-call-key method-primary)
-                         (= eieio-generic-call-key method-static)))
+                     (or (= eieio-generic-call-key eieio--method-primary)
+                         (= eieio-generic-call-key eieio--method-static)))
                     (eieio-generic-call-next-method-list
                      ;; Use the cdr, as the first element is the fcn
                      ;; we are calling right now.
@@ -1818,7 +1815,6 @@ for this common case to improve performance."
   ;; We must expand our arguments first as they are always
   ;; passed in as quoted symbols
   (let ((newargs nil) (mclass nil)  (lambdas nil)
-       (eieio-generic-call-methodname method)
        (eieio-generic-call-arglst args)
        (firstarg nil)
        (primarymethodlist nil)
@@ -1829,15 +1825,11 @@ for this common case to improve performance."
 
     ;; Determine the class to use.
     (cond ((eieio-object-p firstarg)
-          (setq mclass (eieio--object-class firstarg)))
+          (setq mclass (eieio--object-class-name firstarg)))
          ((not firstarg)
           (error "Method %s called on nil" method))
-         ((not (eieio-object-p firstarg))
-          (error "Primary-only method %s called on something not an object" 
method))
          (t
-          (error "EIEIO Error: Improperly classified method %s as primary only"
-                 method)
-         ))
+          (error "Primary-only method %s called on something not an object" 
method)))
     ;; Make sure the class is a valid class
     ;; mclass can be nil (meaning a generic for should be used.
     ;; mclass cannot have a value that is not a class, however.
@@ -1846,15 +1838,15 @@ for this common case to improve performance."
       )
 
     ;; :primary methods
-    (setq lambdas (eieio-generic-form method method-primary mclass))
+    (setq lambdas (eieio-generic-form method eieio--method-primary mclass))
     (setq primarymethodlist  ;; Re-use even with bad name here
-         (eieiomt-method-list method method-primary mclass))
+         (eieiomt-method-list method eieio--method-primary mclass))
 
     ;; Now loop through all occurrences forms which we must execute
     ;; (which are happily sorted now) and execute them all!
-    (eieio--with-scoped-class (cdr lambdas)
+    (eieio--with-scoped-class (eieio--class-v (cdr lambdas))
       (let* ((rval nil) (lastval nil)
-            (eieio-generic-call-key method-primary)
+            (eieio-generic-call-key eieio--method-primary)
             ;; Use the cdr, as the first element is the fcn
             ;; we are calling right now.
             (eieio-generic-call-next-method-list (cdr primarymethodlist))
@@ -1905,7 +1897,7 @@ If CLASS is nil, then an empty list of methods should be 
returned."
 
     ;; Return collected lambda. For :after methods, return in current
     ;; order (most general class last); Otherwise, reverse order.
-    (if (eq key method-after)
+    (if (eq key eieio--method-after)
        lambdas
       (nreverse lambdas))))
 
@@ -1918,7 +1910,7 @@ If CLASS is nil, then an empty list of methods should be 
returned."
 ;; (eieio-method-tree . [BEFORE PRIMARY AFTER
 ;;                       genericBEFORE genericPRIMARY genericAFTER])
 ;; and
-;; (eieio-method-obarray . [BEFORE PRIMARY AFTER
+;; (eieio-method-hashtable . [BEFORE PRIMARY AFTER
 ;;                          genericBEFORE genericPRIMARY genericAFTER])
 ;;    where the association is a vector.
 ;;    (aref 0  -- all static methods.
@@ -1929,25 +1921,22 @@ If CLASS is nil, then an empty list of methods should 
be returned."
 ;;    (aref 5  -- a generic classified as :primary
 ;;    (aref 6  -- a generic classified as :after
 ;;
-(defvar eieiomt-optimizing-obarray nil
-  "While mapping atoms, this contain the obarray being optimized.")
+(defvar eieiomt--optimizing-hashtable nil
+  "While mapping atoms, this contain the hashtable being optimized.")
 
 (defun eieiomt-install (method-name)
-  "Install the method tree, and obarray onto METHOD-NAME.
+  "Install the method tree, and hashtable onto METHOD-NAME.
 Do not do the work if they already exist."
-  (let ((emtv (get method-name 'eieio-method-tree))
-       (emto (get method-name 'eieio-method-obarray)))
-    (if (or (not emtv) (not emto))
-       (progn
-         (setq emtv (put method-name 'eieio-method-tree
-                         (make-vector method-num-slots nil))
-               emto (put method-name 'eieio-method-obarray
-                         (make-vector method-num-slots nil)))
-         (aset emto 0 (make-vector 11 0))
-         (aset emto 1 (make-vector 11 0))
-         (aset emto 2 (make-vector 41 0))
-         (aset emto 3 (make-vector 11 0))
-         ))))
+  (unless (and (get method-name 'eieio-method-tree)
+               (get method-name 'eieio-method-hashtable))
+    (put method-name 'eieio-method-tree
+         (make-vector eieio--method-num-slots nil))
+    (let ((emto (put method-name 'eieio-method-hashtable
+                     (make-vector eieio--method-num-slots nil))))
+      (aset emto 0 (make-hash-table :test 'eq))
+      (aset emto 1 (make-hash-table :test 'eq))
+      (aset emto 2 (make-hash-table :test 'eq))
+      (aset emto 3 (make-hash-table :test 'eq)))))
 
 (defun eieiomt-add (method-name method key class)
   "Add to METHOD-NAME the forms METHOD in a call position KEY for CLASS.
@@ -1957,39 +1946,36 @@ KEY is an integer (see comment in eieio.el near this 
function) which
 is associated with the :static :before :primary and :after tags.
 It also indicates if CLASS is defined or not.
 CLASS is the class this method is associated with."
-  (if (or (> key method-num-slots) (< key 0))
+  (if (or (> key eieio--method-num-slots) (< key 0))
       (error "eieiomt-add: method key error!"))
   (let ((emtv (get method-name 'eieio-method-tree))
-       (emto (get method-name 'eieio-method-obarray)))
+       (emto (get method-name 'eieio-method-hashtable)))
     ;; Make sure the method tables are available.
-    (if (or (not emtv) (not emto))
-       (error "Programmer error: eieiomt-add"))
+    (unless (and emtv emto)
+      (error "Programmer error: eieiomt-add"))
     ;; only add new cells on if it doesn't already exist!
     (if (assq class (aref emtv key))
        (setcdr (assq class (aref emtv key)) method)
       (aset emtv key (cons (cons class method) (aref emtv key))))
     ;; Add function definition into newly created symbol, and store
-    ;; said symbol in the correct obarray, otherwise use the
-    ;; other array to keep this stuff
-    (if (< key method-num-lists)
-       (let ((nsym (intern (symbol-name class) (aref emto key))))
-         (fset nsym method)))
+    ;; said symbol in the correct hashtable, otherwise use the
+    ;; other array to keep this stuff.
+    (if (< key eieio--method-num-lists)
+        (puthash class (list method) (aref emto key)))
     ;; Save the defmethod file location in a symbol property.
     (let ((fname (if load-in-progress
                     load-file-name
-                  buffer-file-name))
-         loc)
+                  buffer-file-name)))
       (when fname
-       (when (string-match "\\.elc$" fname)
+       (when (string-match "\\.elc\\'" fname)
          (setq fname (substring fname 0 (1- (length fname)))))
-       (setq loc (get method-name 'method-locations))
-       (cl-pushnew (list class fname) loc :test 'equal)
-       (put method-name 'method-locations loc)))
-    ;; Now optimize the entire obarray
-    (if (< key method-num-lists)
-       (let ((eieiomt-optimizing-obarray (aref emto key)))
+       (cl-pushnew (list class fname) (get method-name 'method-locations)
+                    :test 'equal)))
+    ;; Now optimize the entire hashtable.
+    (if (< key eieio--method-num-lists)
+       (let ((eieiomt--optimizing-hashtable (aref emto key)))
          ;; @todo - Is this overkill?  Should we just clear the symbol?
-         (mapatoms 'eieiomt-sym-optimize eieiomt-optimizing-obarray)))
+         (maphash #'eieiomt--sym-optimize eieiomt--optimizing-hashtable)))
     ))
 
 (defun eieiomt-next (class)
@@ -2005,21 +1991,19 @@ nil for superclasses.  This function performs no type 
checking!"
          nil
        '(eieio-default-superclass))))
 
-(defun eieiomt-sym-optimize (s)
+(defun eieiomt--sym-optimize (class s)
   "Find the next class above S which has a function body for the optimizer."
   ;; Set the value to nil in case there is no nearest cell.
-  (set s nil)
+  (setcdr s nil)
   ;; Find the nearest cell that has a function body. If we find one,
   ;; we replace the nil from above.
-  (let ((external-symbol (intern-soft (symbol-name s))))
-    (catch 'done
-      (dolist (ancestor
-               (cl-rest (eieio-class-precedence-list external-symbol)))
-       (let ((ov (intern-soft (symbol-name ancestor)
-                              eieiomt-optimizing-obarray)))
-         (when (fboundp ov)
-           (set s ov) ;; store ov as our next symbol
-           (throw 'done ancestor)))))))
+  (catch 'done
+    (dolist (ancestor
+             (cl-rest (eieio-class-precedence-list class)))
+      (let ((ov (gethash ancestor eieiomt--optimizing-hashtable)))
+        (when (car ov)
+          (setcdr s ancestor) ;; store ov as our next symbol
+          (throw 'done ancestor))))))
 
 (defun eieio-generic-form (method key class)
  "Return the lambda form belonging to METHOD using KEY based upon CLASS.
@@ -2027,37 +2011,36 @@ If CLASS is not a class then use `generic' instead.  If 
class has
 no form, but has a parent class, then trace to that parent class.
 The first time a form is requested from a symbol, an optimized path
 is memorized for faster future use."
- (let ((emto (aref (get method 'eieio-method-obarray)
+ (let ((emto (aref (get method 'eieio-method-hashtable)
                   (if class key (eieio-specialized-key-to-generic-key key)))))
    (if (class-p class)
        ;; 1) find our symbol
-       (let ((cs (intern-soft (symbol-name class) emto)))
-        (if (not cs)
-            ;; 2) If there isn't one, then make one.
-            ;;    This can be slow since it only occurs once
-            (progn
-              (setq cs (intern (symbol-name class) emto))
-              ;; 2.1) Cache its nearest neighbor with a quick optimize
-              ;;      which should only occur once for this call ever
-              (let ((eieiomt-optimizing-obarray emto))
-                (eieiomt-sym-optimize cs))))
+       (let ((cs (gethash class emto)))
+        (unless cs
+           ;; 2) If there isn't one, then make one.
+           ;;    This can be slow since it only occurs once
+           (puthash class (setq cs (list nil)) emto)
+           ;; 2.1) Cache its nearest neighbor with a quick optimize
+           ;;      which should only occur once for this call ever
+           (let ((eieiomt--optimizing-hashtable emto))
+             (eieiomt--sym-optimize class cs)))
         ;; 3) If it's bound return this one.
-        (if (fboundp  cs)
-            (cons cs (eieio--class-symbol (class-v class)))
+        (if (car cs)
+            (cons (car cs) class)
           ;; 4) If it's not bound then this variable knows something
-          (if (symbol-value cs)
+          (if (cdr cs)
               (progn
                 ;; 4.1) This symbol holds the next class in its value
-                (setq class (symbol-value cs)
-                      cs (intern-soft (symbol-name class) emto))
+                (setq class (cdr cs)
+                      cs (gethash class emto))
                 ;; 4.2) The optimizer should always have chosen a
                 ;;      function-symbol
-                ;;(if (fboundp cs)
-                (cons cs (eieio--class-symbol (class-v (intern (symbol-name 
class)))))
-                  ;;(error "EIEIO optimizer: erratic data loss!"))
+                ;;(if (car cs)
+                (cons (car cs) class)
+                 ;;(error "EIEIO optimizer: erratic data loss!"))
                 )
-              ;; There never will be a funcall...
-              nil)))
+             ;; There never will be a funcall...
+             nil)))
      ;; for a generic call, what is a list, is the function body we want.
      (let ((emtl (aref (get method 'eieio-method-tree)
                       (if class key (eieio-specialized-key-to-generic-key 
key)))))
@@ -2087,18 +2070,18 @@ is memorized for faster future use."
     (setq key
          (cond ((memq (car args) '(:BEFORE :before))
                 (setq args (cdr args))
-                method-before)
+                eieio--method-before)
                ((memq (car args) '(:AFTER :after))
                 (setq args (cdr args))
-                method-after)
+                eieio--method-after)
                ((memq (car args) '(:STATIC :static))
                 (setq args (cdr args))
-                method-static)
+                eieio--method-static)
                ((memq (car args) '(:PRIMARY :primary))
                 (setq args (cdr args))
-                method-primary)
+                eieio--method-primary)
                ;; Primary key.
-               (t method-primary)))
+               (t eieio--method-primary)))
     ;; Get body, and fix contents of args to be the arguments of the fn.
     (setq body (cdr args)
          args (car args))
@@ -2166,7 +2149,8 @@ is memorized for faster future use."
     ;; Make sure the method tables are installed.
     (eieiomt-install method)
     ;; Apply the actual body of this function.
-    (fset method (eieio-defgeneric-form method doc-string))
+    (put method 'function-documentation doc-string)
+    (fset method (eieio-defgeneric-form method))
     ;; Return the method
     'method))
 (make-obsolete 'eieio-defgeneric nil "24.1")
diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el
index df153ee..15a11dd 100644
--- a/lisp/emacs-lisp/eieio-custom.el
+++ b/lisp/emacs-lisp/eieio-custom.el
@@ -1,4 +1,4 @@
-;;; eieio-custom.el -- eieio object customization
+;;; eieio-custom.el -- eieio object customization  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1999-2001, 2005, 2007-2014 Free Software Foundation,
 ;; Inc.
@@ -70,7 +70,7 @@ of these.")
             :documentation "A number of thingies."))
   "A class for testing the widget on.")
 
-(defcustom eieio-widget-test (eieio-widget-test-class "Foo")
+(defcustom eieio-widget-test (eieio-widget-test-class)
   "Test variable for editing an object."
   :type 'object
   :group 'eieio)
@@ -136,7 +136,7 @@ Updates occur regardless of the current customization 
group.")
           ))
     (widget-value-set vc (widget-value vc))))
 
-(defun eieio-custom-toggle-parent (widget &rest ignore)
+(defun eieio-custom-toggle-parent (widget &rest _)
   "Toggle visibility of parent of WIDGET.
 Optional argument IGNORE is an extraneous parameter."
   (eieio-custom-toggle-hide (widget-get widget :parent)))
@@ -154,7 +154,7 @@ Optional argument IGNORE is an extraneous parameter."
   :clone-object-children nil
   )
 
-(defun eieio-object-match (widget value)
+(defun eieio-object-match (_widget _value)
   "Match info for WIDGET against VALUE."
   ;; Write me
   t)
@@ -193,7 +193,7 @@ Optional argument IGNORE is an extraneous parameter."
   (let* ((chil nil)
         (obj (widget-get widget :value))
         (master-group (widget-get widget :eieio-group))
-        (cv (class-v (eieio--object-class obj)))
+        (cv (eieio--object-class-object obj))
         (slots (eieio--class-public-a cv))
         (flabel (eieio--class-public-custom-label cv))
         (fgroup (eieio--class-public-custom-group cv))
@@ -208,7 +208,8 @@ Optional argument IGNORE is an extraneous parameter."
                         chil)))
     ;; Display information about the group being shown
     (when master-group
-      (let ((groups (class-option (eieio--object-class obj) :custom-groups)))
+      (let ((groups (class-option (eieio--object-class-name obj)
+                                  :custom-groups)))
        (widget-insert "Groups:")
        (while groups
          (widget-insert "  ")
@@ -216,7 +217,7 @@ Optional argument IGNORE is an extraneous parameter."
              (widget-insert "*" (capitalize (symbol-name master-group)) "*")
            (widget-create 'push-button
                           :thing (cons obj (car groups))
-                          :notify (lambda (widget &rest stuff)
+                          :notify (lambda (widget &rest _)
                                     (eieio-customize-object
                                      (car (widget-get widget :thing))
                                      (cdr (widget-get widget :thing))))
@@ -261,7 +262,7 @@ Optional argument IGNORE is an extraneous parameter."
                               (let ((s (symbol-name
                                         (or
                                          (class-slot-initarg
-                                          (eieio--object-class obj)
+                                          (eieio--object-class-name obj)
                                           (car slots))
                                          (car slots)))))
                                 (capitalize
@@ -288,7 +289,7 @@ Optional argument IGNORE is an extraneous parameter."
   "Get the value of WIDGET."
   (let* ((obj (widget-get widget :value))
         (master-group eieio-cog)
-        (cv (class-v (eieio--object-class obj)))
+        (cv (eieio--object-class-object obj))
         (fgroup (eieio--class-public-custom-group cv))
         (wids (widget-get widget :children))
         (name (if (widget-get widget :eieio-show-name)
@@ -296,7 +297,7 @@ Optional argument IGNORE is an extraneous parameter."
                 nil))
         (chil (if (widget-get widget :eieio-show-name)
                   (nthcdr 1 wids) wids))
-        (cv (class-v (eieio--object-class obj)))
+        (cv (eieio--object-class-object obj))
         (slots (eieio--class-public-a cv))
         (fcust (eieio--class-public-custom cv)))
     ;; If there are any prefix widgets, clear them.
@@ -317,11 +318,11 @@ Optional argument IGNORE is an extraneous parameter."
            fgroup (cdr fgroup)
            fcust (cdr fcust)))
     ;; Set any name updates on it.
-    (if name (setf (eieio--object-name obj) name))
+    (if name (eieio-object-set-name-string obj name))
     ;; This is the same object we had before.
     obj))
 
-(defmethod eieio-done-customizing ((obj eieio-default-superclass))
+(defmethod eieio-done-customizing ((_obj eieio-default-superclass))
   "When applying change to a widget, call this method.
 This method is called by the default widget-edit commands.
 User made commands should also call this method when applying changes.
@@ -385,18 +386,18 @@ These groups are specified with the `:group' slot flag."
     (make-local-variable 'eieio-cog)
     (setq eieio-cog g)))
 
-(defmethod eieio-custom-object-apply-reset ((obj eieio-default-superclass))
+(defmethod eieio-custom-object-apply-reset ((_obj eieio-default-superclass))
   "Insert an Apply and Reset button into the object editor.
 Argument OBJ is the object being customized."
   (widget-create 'push-button
-                :notify (lambda (&rest ignore)
+                :notify (lambda (&rest _)
                           (widget-apply eieio-wo :value-get)
                           (eieio-done-customizing eieio-co)
                           (bury-buffer))
                 "Accept")
   (widget-insert "   ")
   (widget-create 'push-button
-                :notify (lambda (&rest ignore)
+                :notify (lambda (&rest _)
                           ;; I think the act of getting it sets
                           ;; its value through the get function.
                           (message "Applying Changes...")
@@ -406,13 +407,13 @@ Argument OBJ is the object being customized."
                 "Apply")
   (widget-insert "   ")
   (widget-create 'push-button
-                :notify (lambda (&rest ignore)
+                :notify (lambda (&rest _)
                           (message "Resetting")
                           (eieio-customize-object eieio-co eieio-cog))
                 "Reset")
   (widget-insert "   ")
   (widget-create 'push-button
-                :notify (lambda (&rest ignore)
+                :notify (lambda (&rest _)
                           (bury-buffer))
                 "Cancel"))
 
@@ -431,13 +432,11 @@ Must return the created widget."
   :clone-object-children t
   )
 
-(defun eieio-object-value-to-abstract (widget value)
+(defun eieio-object-value-to-abstract (_widget value)
   "For WIDGET, convert VALUE to an abstract /safe/ representation."
-  (if (eieio-object-p value) value
-    (if (null value) value
-      nil)))
+  (if (eieio-object-p value) value))
 
-(defun eieio-object-abstract-to-value (widget value)
+(defun eieio-object-abstract-to-value (_widget value)
   "For WIDGET, convert VALUE from an abstract /safe/ representation."
   value)
 
@@ -453,7 +452,7 @@ Must return the created widget."
            (vector (concat "Group " (symbol-name group))
                    (list 'customize-object obj (list 'quote group))
                    t))
-         (class-option (eieio--object-class obj) :custom-groups)))
+         (class-option (eieio--object-class-name obj) :custom-groups)))
 
 (defvar eieio-read-custom-group-history nil
   "History for the custom group reader.")
@@ -461,7 +460,7 @@ Must return the created widget."
 (defmethod eieio-read-customization-group ((obj eieio-default-superclass))
   "Do a completing read on the name of a customization group in OBJ.
 Return the symbol for the group, or nil"
-  (let ((g (class-option (eieio--object-class obj) :custom-groups)))
+  (let ((g (class-option (eieio--object-class-name obj) :custom-groups)))
     (if (= (length g) 1)
        (car g)
       ;; Make the association list
diff --git a/lisp/emacs-lisp/eieio-datadebug.el 
b/lisp/emacs-lisp/eieio-datadebug.el
index ae29c3f..d18501b 100644
--- a/lisp/emacs-lisp/eieio-datadebug.el
+++ b/lisp/emacs-lisp/eieio-datadebug.el
@@ -1,4 +1,4 @@
-;;; eieio-datadebug.el --- EIEIO extensions to the data debugger.
+;;; eieio-datadebug.el --- EIEIO extensions to the data debugger.  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
 
@@ -87,7 +87,7 @@ PREBUTTONTEXT is some text between PREFIX and the object 
button."
                             prefix
                             "Name: ")
     (let* ((cl (eieio-object-class obj))
-          (cv (class-v cl)))
+          (cv (eieio--class-v cl)))
       (data-debug-insert-thing (class-constructor cl)
                               prefix
                               "Class: ")
@@ -137,7 +137,7 @@ PREBUTTONTEXT is some text between PREFIX and the object 
button."
         (data
          (catch 'moose (eieio-generic-call
                         method (list class))))
-        (buf (data-debug-new-buffer "*Method Invocation*"))
+        (_buf (data-debug-new-buffer "*Method Invocation*"))
         (data2 (mapcar (lambda (sym)
                          (symbol-function (car sym)))
                          data)))
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 6f1d01c..1987385 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -60,7 +60,7 @@ Argument PREFIX is the character prefix to use.
 Argument CH-PREFIX is another character prefix to display."
   (eieio--check-type class-p this-root)
   (let ((myname (symbol-name this-root))
-       (chl (eieio--class-children (class-v this-root)))
+       (chl (eieio--class-children (eieio--class-v this-root)))
        (fprefix (concat ch-prefix "  +--"))
        (mprefix (concat ch-prefix "  |  "))
        (lprefix (concat ch-prefix "     ")))
@@ -149,7 +149,7 @@ If CLASS is actually an object, then also display current 
values of that object.
 (defun eieio-help-class-slots (class)
   "Print help description for the slots in CLASS.
 Outputs to the current buffer."
-  (let* ((cv (class-v class))
+  (let* ((cv (eieio--class-v class))
         (docs   (eieio--class-public-doc cv))
         (names  (eieio--class-public-a cv))
         (deflt  (eieio--class-public-d cv))
@@ -218,11 +218,10 @@ Outputs to the current buffer."
 (defun eieio-build-class-list (class)
   "Return a list of all classes that inherit from CLASS."
   (if (class-p class)
-      (apply #'append
-            (mapcar
-             (lambda (c)
-               (append (list c) (eieio-build-class-list c)))
-             (eieio-class-children-fast class)))
+      (cl-mapcan
+       (lambda (c)
+         (append (list c) (eieio-build-class-list c)))
+       (eieio-class-children-fast class))
     (list class)))
 
 (defun eieio-build-class-alist (&optional class instantiable-only buildlist)
@@ -232,14 +231,15 @@ If INSTANTIABLE-ONLY is non nil, only allow names of 
classes which
 are not abstract, otherwise allow all classes.
 Optional argument BUILDLIST is more list to attach and is used internally."
   (let* ((cc (or class eieio-default-superclass))
-        (sublst (eieio--class-children (class-v cc))))
+        (sublst (eieio--class-children (eieio--class-v cc))))
     (unless (assoc (symbol-name cc) buildlist)
       (when (or (not instantiable-only) (not (class-abstract-p cc)))
+        ;; FIXME: Completion tables don't need alists, and ede/generic.el needs
+        ;; the symbols rather than their names.
        (setq buildlist (cons (cons (symbol-name cc) 1) buildlist))))
-    (while sublst
+    (dolist (elem sublst)
       (setq buildlist (eieio-build-class-alist
-                      (car sublst) instantiable-only buildlist))
-      (setq sublst (cdr sublst)))
+                      elem instantiable-only buildlist)))
     buildlist))
 
 (defvar eieio-read-class nil
@@ -378,51 +378,47 @@ are not abstract."
   "Return a list of all generic functions.
 Optional CLASS argument returns only those functions that contain
 methods for CLASS."
-  (let ((l nil) tree (cn (if class (symbol-name class) nil)))
+  (let ((l nil))
     (mapatoms
      (lambda (symbol)
-       (setq tree (get symbol 'eieio-method-obarray))
-       (if tree
-          (progn
-            ;; A symbol might be interned for that class in one of
-            ;; these three slots in the method-obarray.
-            (if (or (not class)
-                    (fboundp (intern-soft cn (aref tree 0)))
-                    (fboundp (intern-soft cn (aref tree 1)))
-                    (fboundp (intern-soft cn (aref tree 2))))
-                (setq l (cons symbol l)))))))
+       (let ((tree (get symbol 'eieio-method-hashtable)))
+         (when tree
+           ;; A symbol might be interned for that class in one of
+           ;; these three slots in the method-obarray.
+           (if (or (not class)
+                   (car (gethash class (aref tree 0)))
+                   (car (gethash class (aref tree 1)))
+                   (car (gethash class (aref tree 2))))
+               (setq l (cons symbol l)))))))
     l))
 
 (defun eieio-method-documentation (generic class)
   "Return a list of the specific documentation of GENERIC for CLASS.
 If there is not an explicit method for CLASS in GENERIC, or if that
 function has no documentation, then return nil."
-  (let ((tree (get generic 'eieio-method-obarray))
-       (cn (symbol-name class))
-       before primary after)
-    (if (not tree)
-       nil
+  (let ((tree (get generic 'eieio-method-hashtable)))
+    (when tree
       ;; A symbol might be interned for that class in one of
-      ;; these three slots in the method-obarray.
-      (setq before (intern-soft cn (aref tree 0))
-           primary (intern-soft cn (aref tree 1))
-           after (intern-soft cn (aref tree 2)))
-      (if (not (or (fboundp before)
-                  (fboundp primary)
-                  (fboundp after)))
-         nil
-       (list (if (fboundp before)
-                 (cons (help-function-arglist before)
-                       (documentation before))
-               nil)
-             (if (fboundp primary)
-                 (cons (help-function-arglist primary)
-                       (documentation primary))
-               nil)
-             (if (fboundp after)
-                 (cons (help-function-arglist after)
-                       (documentation after))
-               nil))))))
+      ;; these three slots in the method-hashtable.
+      ;; FIXME: Where do these 0/1/2 come from?  Isn't 0 for :static,
+      ;; 1 for before, and 2 for primary (and 3 for after)?
+      (let ((before  (car (gethash class (aref tree 0))))
+           (primary (car (gethash class (aref tree 1))))
+           (after   (car (gethash class (aref tree 2)))))
+        (if (not (or before primary after))
+            nil
+          (list (if before
+                    (cons (help-function-arglist before)
+                          (documentation before))
+                  nil)
+                (if primary
+                    (cons (help-function-arglist primary)
+                          (documentation primary))
+                  nil)
+                (if after
+                    (cons (help-function-arglist after)
+                          (documentation after))
+                  nil)))))))
 
 (defvar eieio-read-generic nil
   "History of the `eieio-read-generic' prompt.")
@@ -627,7 +623,7 @@ Optional argument HISTORYVAR is the variable to use as 
history."
   ()
   "Menu part in easymenu format used in speedbar while in `eieio' mode.")
 
-(defun eieio-class-speedbar (dir-or-object depth)
+(defun eieio-class-speedbar (_dir-or-object _depth)
   "Create buttons in speedbar that represents the current project.
 DIR-OR-OBJECT is the object to expand, or nil, and DEPTH is the
 current expansion depth."
@@ -641,7 +637,7 @@ current expansion depth."
 (defun eieio-class-button (class depth)
   "Draw a speedbar button at the current point for CLASS at DEPTH."
   (eieio--check-type class-p class)
-  (let ((subclasses (eieio--class-children (class-v class))))
+  (let ((subclasses (eieio--class-children (eieio--class-v class))))
     (if subclasses
        (speedbar-make-tag-line 'angle ?+
                                'eieio-sb-expand
@@ -666,7 +662,7 @@ Argument INDENT is the depth of indentation."
         (speedbar-with-writable
           (save-excursion
             (end-of-line) (forward-char 1)
-            (let ((subclasses (eieio--class-children (class-v class))))
+            (let ((subclasses (eieio--class-children (eieio--class-v class))))
               (while subclasses
                 (eieio-class-button (car subclasses) (1+ indent))
                 (setq subclasses (cdr subclasses)))))))
@@ -676,7 +672,7 @@ Argument INDENT is the depth of indentation."
        (t (error "Ooops...  not sure what to do")))
   (speedbar-center-buffer-smartly))
 
-(defun eieio-describe-class-sb (text token indent)
+(defun eieio-describe-class-sb (_text token _indent)
   "Describe the class TEXT in TOKEN.
 INDENT is the current indentation level."
   (dframe-with-attached-buffer
diff --git a/lisp/emacs-lisp/eieio-speedbar.el 
b/lisp/emacs-lisp/eieio-speedbar.el
index 85b9cc6..1d031c3 100644
--- a/lisp/emacs-lisp/eieio-speedbar.el
+++ b/lisp/emacs-lisp/eieio-speedbar.el
@@ -1,4 +1,4 @@
-;;; eieio-speedbar.el -- Classes for managing speedbar displays.
+;;; eieio-speedbar.el -- Classes for managing speedbar displays.  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 1999-2002, 2005, 2007-2014 Free Software Foundation,
 ;; Inc.
@@ -200,7 +200,7 @@ that path."
   "Return a string describing OBJECT."
   (eieio-object-name-string object))
 
-(defmethod eieio-speedbar-derive-line-path (object)
+(defmethod eieio-speedbar-derive-line-path (_object)
   "Return the path which OBJECT has something to do with."
   nil)
 
@@ -321,7 +321,7 @@ Argument DEPTH is the depth at which the tag line is 
inserted."
       (if exp
          (eieio-speedbar-expand object (1+ depth))))))
 
-(defmethod eieio-speedbar-child-make-tag-lines ((object eieio-speedbar) depth)
+(defmethod eieio-speedbar-child-make-tag-lines ((object eieio-speedbar) _depth)
   "Base method for creating tag lines for non-object children."
   (error "You must implement `eieio-speedbar-child-make-tag-lines' for %s"
         (eieio-object-name object)))
@@ -340,7 +340,7 @@ OBJECT."
 
 ;;; Speedbar specific function callbacks.
 ;;
-(defun eieio-speedbar-object-click (text token indent)
+(defun eieio-speedbar-object-click (_text token _indent)
   "Handle a user click on TEXT representing object TOKEN.
 The object is at indentation level INDENT."
   (eieio-speedbar-handle-click token))
@@ -412,7 +412,7 @@ Optional DEPTH is the depth we start at."
 
 ;;; Methods to the eieio-speedbar-* classes which need to be overridden.
 ;;
-(defmethod eieio-speedbar-object-children ((object eieio-speedbar))
+(defmethod eieio-speedbar-object-children ((_object eieio-speedbar))
   "Return a list of children to be displayed in speedbar.
 If the return value is a list of OBJECTs, then those objects are
 queried for details.  If the return list is made of strings,
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index c8330d5..e80791f 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -144,12 +144,7 @@ In EIEIO, the class' constructor requires a name for use 
when printing.
 `make-instance' in CLOS doesn't use names the way Emacs does, so the
 class is used as the name slot instead when INITARGS doesn't start with
 a string."
-  (if (and (car initargs) (stringp (car initargs)))
-      (apply (class-constructor class) initargs)
-    (apply  (class-constructor class)
-           (cond ((symbolp class) (symbol-name class))
-                 (t (format "%S" class)))
-           initargs)))
+  (apply (class-constructor class) initargs))
 
 
 ;;; CLOS methods and generics
@@ -191,7 +186,16 @@ Summary:
                      ((typearg class-name) arg2 &optional opt &rest rest)
     \"doc-string\"
      body)"
-  (declare (doc-string 3))
+  (declare (doc-string 3)
+           (debug
+            (&define                    ; this means we are defining something
+             [&or name ("setf" :name setf name)]
+             ;; ^^ This is the methods symbol
+             [ &optional symbolp ]                ; this is key :before etc
+             list                                 ; arguments
+             [ &optional stringp ]                ; documentation string
+             def-body                             ; part to be debugged
+             )))
   (let* ((key (if (keywordp (car args)) (pop args)))
         (params (car args))
         (arg1 (car params))
@@ -213,6 +217,7 @@ Summary:
   "Retrieve the value stored in OBJ in the slot named by SLOT.
 Slot is the name of the slot when created by `defclass' or the label
 created by the :initarg tag."
+  (declare (debug (form symbolp)))
   `(eieio-oref ,obj (quote ,slot)))
 
 (defalias 'slot-value 'eieio-oref)
@@ -223,6 +228,7 @@ created by the :initarg tag."
 The default value is the value installed in a class with the :initform
 tag.  SLOT can be the slot name, or the tag specified by the :initarg
 tag in the `defclass' call."
+  (declare (debug (form symbolp)))
   `(eieio-oref-default ,obj (quote ,slot)))
 
 ;;; Handy CLOS macros
@@ -246,7 +252,7 @@ SPEC-LIST is of a form similar to `let'.  For example:
 Where each VAR is the local variable given to the associated
 SLOT.  A slot specified without a variable name is given a
 variable name of the same name as the slot."
-  (declare (indent 2))
+  (declare (indent 2) (debug (sexp sexp def-body)))
   (require 'cl-lib)
   ;; Transform the spec-list into a cl-symbol-macrolet spec-list.
   (let ((mappings (mapcar (lambda (entry)
@@ -261,33 +267,43 @@ variable name of the same name as the slot."
 ;;  well embedded into an object.
 ;;
 (define-obsolete-function-alias
-  'object-class-fast #'eieio--object-class "24.4")
+  'object-class-fast #'eieio--object-class-name "24.4")
 
 (defun eieio-object-name (obj &optional extra)
   "Return a Lisp like symbol string for object OBJ.
 If EXTRA, include that in the string returned to represent the symbol."
   (eieio--check-type eieio-object-p obj)
-  (format "#<%s %s%s>" (symbol-name (eieio--object-class obj))
-         (eieio--object-name obj) (or extra "")))
+  (format "#<%s %s%s>" (eieio--object-class-name obj)
+         (eieio-object-name-string obj) (or extra "")))
 (define-obsolete-function-alias 'object-name #'eieio-object-name "24.4")
 
-(defun eieio-object-name-string (obj) "Return a string which is OBJ's name."
-  (eieio--check-type eieio-object-p obj)
-  (eieio--object-name obj))
+(defconst eieio--object-names (make-hash-table :test #'eq :weakness 'key))
+
+;; In the past, every EIEIO object had a `name' field, so we had the two method
+;; below "for free".  Since this field is very rarely used, we got rid of it
+;; and instead we keep it in a weak hash-tables, for those very rare objects
+;; that use it.
+(defmethod eieio-object-name-string (obj)
+  "Return a string which is OBJ's name."
+  (declare (obsolete eieio-named "25.1"))
+  (or (gethash obj eieio--object-names)
+      (symbol-name (eieio-object-class obj))))
 (define-obsolete-function-alias
   'object-name-string #'eieio-object-name-string "24.4")
 
-(defun eieio-object-set-name-string (obj name)
+(defmethod eieio-object-set-name-string (obj name)
   "Set the string which is OBJ's NAME."
-  (eieio--check-type eieio-object-p obj)
+  (declare (obsolete eieio-named "25.1"))
   (eieio--check-type stringp name)
-  (setf (eieio--object-name obj) name))
+  (setf (gethash obj eieio--object-names) name))
 (define-obsolete-function-alias
   'object-set-name-string 'eieio-object-set-name-string "24.4")
 
-(defun eieio-object-class (obj) "Return the class struct defining OBJ."
+(defun eieio-object-class (obj)
+  "Return the class struct defining OBJ."
+  ;; FIXME: We say we return a "struct" but we return a symbol instead!
   (eieio--check-type eieio-object-p obj)
-  (eieio--object-class obj))
+  (eieio--object-class-name obj))
 (define-obsolete-function-alias 'object-class #'eieio-object-class "24.4")
 ;; CLOS name, maybe?
 (define-obsolete-function-alias 'class-of #'eieio-object-class "24.4")
@@ -295,7 +311,7 @@ If EXTRA, include that in the string returned to represent 
the symbol."
 (defun eieio-object-class-name (obj)
   "Return a Lisp like symbol name for OBJ's class."
   (eieio--check-type eieio-object-p obj)
-  (eieio-class-name (eieio--object-class obj)))
+  (eieio-class-name (eieio--object-class-name obj)))
 (define-obsolete-function-alias
   'object-class-name 'eieio-object-class-name "24.4")
 
@@ -335,29 +351,35 @@ The CLOS function `class-direct-subclasses' is aliased to 
this function."
   "Return non-nil if OBJ is an instance of CLASS or CLASS' subclasses."
   (eieio--check-type eieio-object-p obj)
   ;; class will be checked one layer down
-  (child-of-class-p (eieio--object-class obj) class))
+  (child-of-class-p (eieio--object-class-object obj) class))
 ;; Backwards compatibility
 (defalias 'obj-of-class-p 'object-of-class-p)
 
 (defun child-of-class-p (child class)
   "Return non-nil if CHILD class is a subclass of CLASS."
-  (eieio--check-type class-p class)
-  (eieio--check-type class-p child)
-  (let ((p nil))
-    (while (and child (not (eq child class)))
-      (setq p (append p (eieio--class-parent (class-v child)))
-           child (car p)
-           p (cdr p)))
-    (if child t)))
+  (setq child (eieio--class-object child))
+  (eieio--check-type eieio--class-p child)
+  ;; `eieio-default-superclass' is never mentioned in eieio--class-parent,
+  ;; so we have to special case it here.
+  (or (eq class 'eieio-default-superclass)
+      (let ((p nil))
+        (setq class (eieio--class-object class))
+        (eieio--check-type eieio--class-p class)
+        (while (and child (not (eq child class)))
+          ;; FIXME: eieio--class-parent should return class-objects rather than
+          ;; class-names!
+          (setq p (append p (eieio--class-parent child))
+                child (eieio--class-v (pop p))))
+        (if child t))))
 
 (defun object-slots (obj)
   "Return list of slots available in OBJ."
   (eieio--check-type eieio-object-p obj)
-  (eieio--class-public-a (class-v (eieio--object-class obj))))
+  (eieio--class-public-a (eieio--object-class-object obj)))
 
 (defun class-slot-initarg (class slot) "Fetch from CLASS, SLOT's :initarg."
   (eieio--check-type class-p class)
-  (let ((ia (eieio--class-initarg-tuples (class-v class)))
+  (let ((ia (eieio--class-initarg-tuples (eieio--class-v class)))
        (f nil))
     (while (and ia (not f))
       (if (eq (cdr (car ia)) slot)
@@ -371,6 +393,7 @@ The CLOS function `class-direct-subclasses' is aliased to 
this function."
   "Set the value in OBJ for slot SLOT to VALUE.
 SLOT is the slot name as specified in `defclass' or the tag created
 with in the :initarg slot.  VALUE can be any Lisp object."
+  (declare (debug (form symbolp form)))
   `(eieio-oset ,obj (quote ,slot) ,value))
 
 (defmacro oset-default (class slot value)
@@ -378,6 +401,7 @@ with in the :initarg slot.  VALUE can be any Lisp object."
 The default value is usually set with the :initform tag during class
 creation.  This allows users to change the default behavior of classes
 after they are created."
+  (declare (debug (form symbolp form)))
   `(eieio-oset-default ,class (quote ,slot) ,value))
 
 ;;; CLOS queries into classes and slots
@@ -402,7 +426,7 @@ OBJECT can be an instance or a class."
 
 (defun slot-exists-p (object-or-class slot)
   "Return non-nil if OBJECT-OR-CLASS has SLOT."
-  (let ((cv (class-v (cond ((eieio-object-p object-or-class)
+  (let ((cv (eieio--class-v (cond ((eieio-object-p object-or-class)
                            (eieio-object-class object-or-class))
                           ((class-p object-or-class)
                            object-or-class))
@@ -418,7 +442,7 @@ If ERRORP is non-nil, `wrong-argument-type' is signaled."
   (if (not (class-p symbol))
       (if errorp (signal 'wrong-type-argument (list 'class-p symbol))
        nil)
-    (class-v symbol)))
+    (eieio--class-v symbol)))
 
 ;;; Slightly more complex utility functions for objects
 ;;
@@ -517,21 +541,21 @@ arguments passed in at the top level.
 Use `next-method-p' to find out if there is a next method to call."
   (if (not (eieio--scoped-class))
       (error "`call-next-method' not called within a class specific method"))
-  (if (and (/= eieio-generic-call-key method-primary)
-          (/= eieio-generic-call-key method-static))
+  (if (and (/= eieio-generic-call-key eieio--method-primary)
+          (/= eieio-generic-call-key eieio--method-static))
       (error "Cannot `call-next-method' except in :primary or :static methods")
     )
   (let ((newargs (or replacement-args eieio-generic-call-arglst))
        (next (car eieio-generic-call-next-method-list))
        )
-    (if (or (not next) (not (car next)))
+    (if (not (and next (car next)))
        (apply #'no-next-method (car newargs) (cdr newargs))
       (let* ((eieio-generic-call-next-method-list
              (cdr eieio-generic-call-next-method-list))
             (eieio-generic-call-arglst newargs)
             (fcn (car next))
             )
-       (eieio--with-scoped-class (cdr next)
+       (eieio--with-scoped-class (eieio--class-v (cdr next))
          (apply fcn newargs)) ))))
 
 ;;; Here are some CLOS items that need the CL package
@@ -558,20 +582,19 @@ This class is not stored in the `parent' slot of a class 
vector."
 
 (defalias 'standard-class 'eieio-default-superclass)
 
-(defgeneric constructor (class newname &rest slots)
+(defgeneric eieio-constructor (class &rest slots)
   "Default constructor for CLASS `eieio-default-superclass'.")
 
-(defmethod constructor :static
-  ((class eieio-default-superclass) newname &rest slots)
+(define-obsolete-function-alias 'constructor #'eieio-constructor "25.1")
+
+(defmethod eieio-constructor :static
+  ((class eieio-default-superclass) &rest slots)
   "Default constructor for CLASS `eieio-default-superclass'.
-NEWNAME is the name to be given to the constructed object.
 SLOTS are the initialization slots used by `shared-initialize'.
 This static method is called when an object is constructed.
 It allocates the vector used to represent an EIEIO object, and then
 calls `shared-initialize' on that object."
-  (let* ((new-object (copy-sequence (eieio--class-default-object-cache 
(class-v class)))))
-    ;; Update the name for the newly created object.
-    (setf (eieio--object-name new-object) newname)
+  (let* ((new-object (copy-sequence (eieio--class-default-object-cache 
(eieio--class-v class)))))
     ;; Call the initialize method on the new object with the slots
     ;; that were passed down to us.
     (initialize-instance new-object slots)
@@ -585,10 +608,10 @@ Called from the constructor routine.")
 (defmethod shared-initialize ((obj eieio-default-superclass) slots)
   "Set slots of OBJ with SLOTS which is a list of name/value pairs.
 Called from the constructor routine."
-  (eieio--with-scoped-class (eieio--object-class obj)
+  (eieio--with-scoped-class (eieio--object-class-object obj)
     (while slots
-      (let ((rn (eieio-initarg-to-attribute (eieio--object-class obj)
-                                           (car slots))))
+      (let ((rn (eieio--initarg-to-attribute (eieio--object-class-object obj)
+                                             (car slots))))
        (if (not rn)
            (slot-missing obj (car slots) 'oset (car (cdr slots)))
          (eieio-oset obj rn (car (cdr slots)))))
@@ -609,7 +632,7 @@ not taken, then new objects of your class will not have 
their values
 dynamically set from SLOTS."
   ;; First, see if any of our defaults are `lambda', and
   ;; re-evaluate them and apply the value to our slots.
-  (let* ((this-class (class-v (eieio--object-class this)))
+  (let* ((this-class (eieio--object-class-object this))
         (slot (eieio--class-public-a this-class))
         (defaults (eieio--class-public-d this-class)))
     (while slot
@@ -699,18 +722,10 @@ first and modify the returned object.")
 
 (defmethod clone ((obj eieio-default-superclass) &rest params)
   "Make a copy of OBJ, and then apply PARAMS."
-  (let ((nobj (copy-sequence obj))
-       (nm (eieio--object-name obj))
-       (passname (and params (stringp (car params))))
-       (num 1))
-    (if params (shared-initialize nobj (if passname (cdr params) params)))
-    (if (not passname)
-       (save-match-data
-         (if (string-match "-\\([0-9]+\\)" nm)
-             (setq num (1+ (string-to-number (match-string 1 nm)))
-                   nm (substring nm 0 (match-beginning 0))))
-         (setf (eieio--object-name nobj) (concat nm "-" (int-to-string num))))
-      (setf (eieio--object-name nobj) (car params)))
+  (let ((nobj (copy-sequence obj)))
+    (if (stringp (car params))
+        (message "Obsolete name %S passed to clone" (pop params)))
+    (if params (shared-initialize nobj params))
     nobj))
 
 (defgeneric destructor (this &rest params)
@@ -764,7 +779,7 @@ this object."
     (princ comment)
     (princ "\n"))
   (let* ((cl (eieio-object-class this))
-        (cv (class-v cl)))
+        (cv (eieio--class-v cl)))
     ;; Now output readable lisp to recreate this object
     ;; It should look like this:
     ;; (<constructor> <name> <slot> <slot> ... )
@@ -867,35 +882,13 @@ variable PRINT-FUNCTION.  Optional argument NOESCAPE is 
passed to
                  ")"))
        (t (funcall print-function object noescape))))
 
-(add-hook 'edebug-setup-hook
-         (lambda ()
-           (def-edebug-spec defmethod
-             (&define                  ; this means we are defining something
-              [&or name ("setf" :name setf name)]
-              ;; ^^ This is the methods symbol
-              [ &optional symbolp ]    ; this is key :before etc
-              list              ; arguments
-              [ &optional stringp ]    ; documentation string
-              def-body                 ; part to be debugged
-              ))
-           ;; The rest of the macros
-           (def-edebug-spec oref (form quote))
-           (def-edebug-spec oref-default (form quote))
-           (def-edebug-spec oset (form quote form))
-           (def-edebug-spec oset-default (form quote form))
-           (def-edebug-spec class-v form)
-           (def-edebug-spec class-p form)
-           (def-edebug-spec eieio-object-p form)
-           (def-edebug-spec class-constructor form)
-           (def-edebug-spec generic-p form)
-           (def-edebug-spec with-slots (list list def-body))
-           (advice-add 'edebug-prin1-to-string
-                       :around #'eieio-edebug-prin1-to-string)))
+(advice-add 'edebug-prin1-to-string
+            :around #'eieio-edebug-prin1-to-string)
 
 
 ;;; Start of automatically extracted autoloads.
 
-;;;### (autoloads nil "eieio-custom" "eieio-custom.el" 
"ab711689b2bae8a7d8c4b1e99c892306")
+;;;### (autoloads nil "eieio-custom" "eieio-custom.el" 
"2b4c57cf907e879e8bbc88d8f0e2de4c")
 ;;; Generated autoloads from eieio-custom.el
 
 (autoload 'customize-object "eieio-custom" "\
@@ -906,7 +899,7 @@ Optional argument GROUP is the sub-group of slots to 
display.
 
 ;;;***
 
-;;;### (autoloads nil "eieio-opt" "eieio-opt.el" 
"889c0a935dddf758dbb65488470ffa06")
+;;;### (autoloads nil "eieio-opt" "eieio-opt.el" 
"2ff7d98da3f84c6af5c873ffb781930e")
 ;;; Generated autoloads from eieio-opt.el
 
 (autoload 'eieio-browse "eieio-opt" "\
diff --git a/test/ChangeLog b/test/ChangeLog
index 7d23b3e..53e2c49 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,24 @@
+2014-12-29  Stefan Monnier  <address@hidden>
+
+       * automated/eieio-test-methodinvoke.el (eieio-test-method-store):
+       Adjust to new semantics of eieio--scoped-class.
+       (eieio-test-match): Improve error feedback.
+
+2014-12-23  Stefan Monnier  <address@hidden>
+
+       * automated/eieio-tests.el: Remove dummy object names.
+
+       * automated/eieio-test-persist.el (persistent-with-objs-slot-subs):
+       The type FOO-child is the same as FOO.
+
+2014-12-22  Stefan Monnier  <address@hidden>
+
+       * automated/eieio-test-methodinvoke.el (eieio-test-method-store):
+       Remove use of eieio-generic-call-methodname.
+       (eieio-test-method-order-list-3, eieio-test-method-order-list-6)
+       (eieio-test-method-order-list-7, eieio-test-method-order-list-8):
+       Adjust the expected result accordingly.
+
 2014-12-19  Artur Malabarba  <address@hidden>
 
        * automated/let-alist.el: require `cl-lib'
@@ -27,8 +48,8 @@
        (vc-test--create-repo-function): Rename from
        `vc-test--create-repo-if-not-supported'.  Adapt all callees.
        (vc-test--create-repo): Check also for revision-granularity.
-       (vc-test--unregister-function): Additional argument FILE.  Adapt
-       all callees.
+       (vc-test--unregister-function): Additional argument FILE.
+       Adapt all callees.
        (vc-test--working-revision): New defun.
        (vc-test-*-working-revision): New tests.
 
@@ -65,7 +86,7 @@
 2014-11-21  Ulf Jasper  <address@hidden>
 
        * automated/libxml-tests.el
-       (libxml-tests--data-comments-preserved): Renamed from
+       (libxml-tests--data-comments-preserved): Rename from
        'libxml-tests--data'.
        (libxml-tests--data-comments-discarded): New.
        (libxml-tests): Check whether 'libxml-parse-xml-region' is
@@ -92,8 +113,8 @@
 
 2014-11-17  Ulf Jasper  <address@hidden>
 
-       * automated/icalendar-tests.el (icalendar-tests--test-export): New
-       optional parameter `alarms'.
+       * automated/icalendar-tests.el (icalendar-tests--test-export):
+       New optional parameter `alarms'.
        (icalendar-export-alarms): New test for exporting icalendar
        alarms.
        (icalendar-tests--test-cycle): Let `icalendar-export-alarms' be nil.
@@ -107,8 +128,8 @@
 
 2014-11-16  Ulf Jasper  <address@hidden>
 
-       * automated/icalendar-tests.el (icalendar--parse-vtimezone): Add
-       testcase where offsets of standard time and daylight saving time
+       * automated/icalendar-tests.el (icalendar--parse-vtimezone):
+       Add testcase where offsets of standard time and daylight saving time
        are equal.
        (icalendar-real-world): Fix error in test case.  Expected result
        was wrong when offsets of standard time and daylight saving time
diff --git a/test/automated/eieio-test-methodinvoke.el 
b/test/automated/eieio-test-methodinvoke.el
index 0b0dd5d..f99ee8d 100644
--- a/test/automated/eieio-test-methodinvoke.el
+++ b/test/automated/eieio-test-methodinvoke.el
@@ -61,15 +61,16 @@
   "Store current invocation class symbol in the invocation order list."
   (let* ((keysym (aref [ :STATIC :BEFORE :PRIMARY :AFTER ]
                       (or eieio-generic-call-key 0)))
-        (c (list eieio-generic-call-methodname keysym (eieio--scoped-class))))
-    (setq eieio-test-method-order-list
-         (cons c eieio-test-method-order-list))))
+         ;; FIXME: Don't depend on `eieio--scoped-class'!
+        (c (list keysym (eieio--class-symbol (eieio--scoped-class)))))
+    (push c eieio-test-method-order-list)))
 
 (defun eieio-test-match (rightanswer)
   "Do a test match."
   (if (equal rightanswer eieio-test-method-order-list)
       t
-    (error "eieio-test-methodinvoke.el: Test Failed!")))
+    (error "eieio-test-methodinvoke.el: Test Failed: %S != %S"
+           rightanswer eieio-test-method-order-list)))
 
 (defvar eieio-test-call-next-method-arguments nil
   "List of passed to methods during execution of `call-next-method'.")
@@ -120,17 +121,17 @@
 (ert-deftest eieio-test-method-order-list-3 ()
   (let ((eieio-test-method-order-list nil)
        (ans '(
-              (eitest-F :BEFORE eitest-B)
-              (eitest-F :BEFORE eitest-B-base1)
-              (eitest-F :BEFORE eitest-B-base2)
+              (:BEFORE eitest-B)
+              (:BEFORE eitest-B-base1)
+              (:BEFORE eitest-B-base2)
 
-              (eitest-F :PRIMARY eitest-B)
-              (eitest-F :PRIMARY eitest-B-base1)
-              (eitest-F :PRIMARY eitest-B-base2)
+              (:PRIMARY eitest-B)
+              (:PRIMARY eitest-B-base1)
+              (:PRIMARY eitest-B-base2)
 
-              (eitest-F :AFTER eitest-B-base2)
-              (eitest-F :AFTER eitest-B-base1)
-              (eitest-F :AFTER eitest-B)
+              (:AFTER eitest-B-base2)
+              (:AFTER eitest-B-base1)
+              (:AFTER eitest-B)
               )))
     (eitest-F (eitest-B nil))
     (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list))
@@ -175,17 +176,18 @@
 (defclass C-base2 () ())
 (defclass C (C-base1 C-base2) ())
 
+;; Just use the obsolete name once, to make sure it also works.
 (defmethod constructor :STATIC ((p C-base1) &rest args)
   (eieio-test-method-store)
   (if (next-method-p) (call-next-method))
   )
 
-(defmethod constructor :STATIC ((p C-base2) &rest args)
+(defmethod eieio-constructor :STATIC ((p C-base2) &rest args)
   (eieio-test-method-store)
   (if (next-method-p) (call-next-method))
   )
 
-(defmethod constructor :STATIC ((p C) &rest args)
+(defmethod eieio-constructor :STATIC ((p C) &rest args)
   (eieio-test-method-store)
   (call-next-method)
   )
@@ -193,9 +195,9 @@
 (ert-deftest eieio-test-method-order-list-6 ()
   (let ((eieio-test-method-order-list nil)
        (ans '(
-              (constructor :STATIC C)
-              (constructor :STATIC C-base1)
-              (constructor :STATIC C-base2)
+              (:STATIC C)
+              (:STATIC C-base1)
+              (:STATIC C-base2)
               )))
     (C nil)
     (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list))
@@ -238,10 +240,10 @@
 (ert-deftest eieio-test-method-order-list-7 ()
   (let ((eieio-test-method-order-list nil)
        (ans '(
-              (eitest-F :PRIMARY D)
-              (eitest-F :PRIMARY D-base1)
-              ;; (eitest-F :PRIMARY D-base2)
-              (eitest-F :PRIMARY D-base0)
+              (:PRIMARY D)
+              (:PRIMARY D-base1)
+              ;; (:PRIMARY D-base2)
+              (:PRIMARY D-base0)
               )))
     (eitest-F (D nil))
     (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list))
@@ -277,10 +279,10 @@
 (ert-deftest eieio-test-method-order-list-8 ()
   (let ((eieio-test-method-order-list nil)
        (ans '(
-              (eitest-F :PRIMARY E)
-              (eitest-F :PRIMARY E-base1)
-              (eitest-F :PRIMARY E-base2)
-              (eitest-F :PRIMARY E-base0)
+              (:PRIMARY E)
+              (:PRIMARY E-base1)
+              (:PRIMARY E-base2)
+              (:PRIMARY E-base0)
               )))
     (eitest-F (E nil))
     (setq eieio-test-method-order-list (nreverse eieio-test-method-order-list))
diff --git a/test/automated/eieio-test-persist.el 
b/test/automated/eieio-test-persist.el
index 6869c7e..00de3cf 100644
--- a/test/automated/eieio-test-persist.el
+++ b/test/automated/eieio-test-persist.el
@@ -40,7 +40,7 @@
   (let* ((file (oref original :file))
         (class (eieio-object-class original))
         (fromdisk (eieio-persistent-read file class))
-        (cv (class-v class))
+        (cv (eieio--class-v class))
         (slot-names  (eieio--class-public-a cv))
         (slot-deflt  (eieio--class-public-d cv))
         )
@@ -175,7 +175,7 @@ persistent class.")
 
 (defclass persistent-with-objs-slot-subs (eieio-persistent)
   ((pnp :initarg :pnp
-       :type (or null persist-not-persistent-child)
+       :type (or null persist-not-persistent)
        :initform nil))
   "Class for testing the saving of slots with objects in them.")
 
diff --git a/test/automated/eieio-tests.el b/test/automated/eieio-tests.el
index 9a88862..91ddfc4 100644
--- a/test/automated/eieio-tests.el
+++ b/test/automated/eieio-tests.el
@@ -157,7 +157,7 @@
 (ert-deftest eieio-test-02-abstract-class ()
   ;; Abstract classes cannot be instantiated, so this should throw an
   ;; error
-  (should-error (abstract-class "Test")))
+  (should-error (abstract-class)))
 
 (defgeneric generic1 () "First generic function")
 
@@ -179,7 +179,7 @@
     "Method generic1 that can take a non-object."
     not-an-object)
 
-  (let ((ans-obj (generic1 (class-a "test")))
+  (let ((ans-obj (generic1 (class-a)))
        (ans-num (generic1 666)))
     (should (eq ans-obj 'monkey))
     (should (eq ans-num 666))))
@@ -200,7 +200,7 @@ Argument C is the class bound to this static method."
   ;; Call static method on a class and see if it worked
   (static-method-class-method static-method-class 'class)
   (should (eq (oref static-method-class some-slot) 'class))
-  (static-method-class-method (static-method-class "test") 'object)
+  (static-method-class-method (static-method-class) 'object)
   (should (eq (oref static-method-class some-slot) 'object)))
 
 (ert-deftest eieio-test-05-static-method-2 ()
@@ -216,7 +216,7 @@ Argument C is the class bound to this static method."
 
   (static-method-class-method static-method-class-2 'class)
   (should (eq (oref static-method-class-2 some-slot) 'moose-class))
-  (static-method-class-method (static-method-class-2 "test") 'object)
+  (static-method-class-method (static-method-class-2) 'object)
   (should (eq (oref static-method-class-2 some-slot) 'moose-object)))
 
 
@@ -230,14 +230,14 @@ Argument C is the class bound to this static method."
 (defvar eitest-b nil)
 (ert-deftest eieio-test-06-allocate-objects ()
    ;; allocate an object to use
-   (should (setq eitest-ab (class-ab "abby")))
-   (should (setq eitest-a (class-a "aye")))
-   (should (setq eitest-b (class-b "fooby"))))
+   (should (setq eitest-ab (class-ab)))
+   (should (setq eitest-a (class-a)))
+   (should (setq eitest-b (class-b))))
 
 (ert-deftest eieio-test-07-make-instance ()
   (should (make-instance 'class-ab))
   (should (make-instance 'class-a :water 'cho))
-  (should (make-instance 'class-b "a name")))
+  (should (make-instance 'class-b)))
 
 (defmethod class-cn ((a class-a))
   "Try calling `call-next-method' when there isn't one.
@@ -354,7 +354,7 @@ METHOD is the method that was attempting to be called."
     (call-next-method)
     (oset a test-tag 1))
 
-  (let ((ca (class-a "class act")))
+  (let ((ca (class-a)))
     (should-not (/=  (oref ca test-tag) 2))))
 
 
@@ -403,7 +403,7 @@ METHOD is the method that was attempting to be called."
    (t (call-next-method))))
 
 (ert-deftest eieio-test-17-virtual-slot ()
-  (setq eitest-vsca (virtual-slot-class "eitest-vsca" :base-value 1))
+  (setq eitest-vsca (virtual-slot-class :base-value 1))
   ;; Check slot values
   (should (= (oref eitest-vsca :base-value) 1))
   (should (= (oref eitest-vsca :derived-value) 2))
@@ -418,7 +418,7 @@ METHOD is the method that was attempting to be called."
 
   ;; should also be possible to initialize instance using virtual slot
 
-  (setq eitest-vscb (virtual-slot-class "eitest-vscb" :derived-value 5))
+  (setq eitest-vscb (virtual-slot-class :derived-value 5))
   (should (= (oref eitest-vscb :base-value) 4))
   (should (= (oref eitest-vscb :derived-value) 5)))
 
@@ -444,7 +444,7 @@ METHOD is the method that was attempting to be called."
   ;; After setting 'water to 'moose, make sure a new object has
   ;; the right stuff.
   (oset-default (eieio-object-class eitest-a) water 'penguin)
-  (should (eq (oref (class-a "foo") water) 'penguin))
+  (should (eq (oref (class-a) water) 'penguin))
 
   ;; Revert the above
   (defmethod slot-unbound ((a class-a) &rest foo)
@@ -458,12 +458,12 @@ METHOD is the method that was attempting to be called."
   ;; We should not be able to set a string here
   (should-error (oset eitest-ab water "a string, not a symbol") :type 
'invalid-slot-type)
   (should-error (oset eitest-ab classslot "a string, not a symbol") :type 
'invalid-slot-type)
-  (should-error (class-a "broken-type-a" :water "a string not a symbol") :type 
'invalid-slot-type))
+  (should-error (class-a :water "a string not a symbol") :type 
'invalid-slot-type))
 
 (ert-deftest eieio-test-20-class-allocated-slots ()
   ;; Test out class allocated slots
   (defvar eitest-aa nil)
-  (setq eitest-aa (class-a "another"))
+  (setq eitest-aa (class-a))
 
   ;; Make sure class slots do not track between objects
   (let ((newval 'moose))
@@ -498,7 +498,7 @@ METHOD is the method that was attempting to be called."
 (ert-deftest eieio-test-21-eval-at-construction-time ()
   ;; initforms that need to be evalled at construction time.
   (setq eieio-test-permuting-value 2)
-  (setq eitest-pvinit (inittest "permuteme"))
+  (setq eitest-pvinit (inittest))
 
   (should (eq (oref eitest-pvinit staticval) 1))
   (should (eq (oref eitest-pvinit symval) 'eieio-test-permuting-value))
@@ -514,11 +514,11 @@ METHOD is the method that was attempting to be called."
     "Test class that will be a calculated value.")
 
   (defclass eitest-superior nil
-    ((sub :initform (eitest-subordinate "test")
+    ((sub :initform (eitest-subordinate)
          :type eitest-subordinate))
     "A class with an initform that creates a class.")
 
-  (should (setq eitest-tests (eitest-superior "test")))
+  (should (setq eitest-tests (eitest-superior)))
 
   (should-error
    (eval
@@ -546,8 +546,8 @@ METHOD is the method that was attempting to be called."
   (should (not (class-a-child-p "foo"))))
 
 (ert-deftest eieio-test-24-object-predicates ()
-  (let ((listooa (list (class-ab "ab") (class-a "a")))
-       (listoob (list (class-ab "ab") (class-b "b"))))
+  (let ((listooa (list (class-ab) (class-a)))
+       (listoob (list (class-ab) (class-b))))
     (should (class-a-list-p listooa))
     (should (class-b-list-p listoob))
     (should-not (class-b-list-p listooa))
@@ -555,7 +555,7 @@ METHOD is the method that was attempting to be called."
 
 (defvar eitest-t1 nil)
 (ert-deftest eieio-test-25-slot-tests ()
-  (setq eitest-t1 (class-c "C1"))
+  (setq eitest-t1 (class-c))
   ;; Slot initialization
   (should (eq (oref eitest-t1 slot-1) 'moose))
   (should (eq (oref eitest-t1 :moose) 'moose))
@@ -564,7 +564,7 @@ METHOD is the method that was attempting to be called."
   ;; Check private slot accessor
   (should (string= (get-slot-2 eitest-t1) "penguin"))
   ;; Pass string instead of symbol
-  (should-error (class-c "C2" :moose "not a symbol") :type 'invalid-slot-type)
+  (should-error (class-c :moose "not a symbol") :type 'invalid-slot-type)
   (should (eq (get-slot-3 eitest-t1) 'emu))
   (should (eq (get-slot-3 class-c) 'emu))
   ;; Check setf
@@ -576,13 +576,13 @@ METHOD is the method that was attempting to be called."
 (defvar eitest-t2 nil)
 (ert-deftest eieio-test-26-default-inheritance ()
   ;; See previous test, nor for subclass
-  (setq eitest-t2 (class-subc "subc"))
+  (setq eitest-t2 (class-subc))
   (should (eq (oref eitest-t2 slot-1) 'moose))
   (should (eq (oref eitest-t2 :moose) 'moose))
   (should (string= (get-slot-2 eitest-t2) "linux"))
   (should-error (oref eitest-t2 slot-2) :type 'invalid-slot-name)
   (should (string= (get-slot-2 eitest-t2) "linux"))
-  (should-error (class-subc "C2" :moose "not a symbol") :type 
'invalid-slot-type))
+  (should-error (class-subc :moose "not a symbol") :type 'invalid-slot-type))
 
 ;;(ert-deftest eieio-test-27-inherited-new-value ()
   ;;; HACK ALERT: The new value of a class slot is inherited by the
@@ -646,8 +646,8 @@ Do not override for `prot-2'."
 (defvar eitest-p1 nil)
 (defvar eitest-p2 nil)
 (ert-deftest eieio-test-28-slot-protection ()
-  (setq eitest-p1 (prot-1 ""))
-  (setq eitest-p2 (prot-2 ""))
+  (setq eitest-p1 (prot-1))
+  (setq eitest-p2 (prot-2))
   ;; Access public slots
   (oref eitest-p1 slot-1)
   (oref eitest-p2 slot-1)
@@ -742,7 +742,7 @@ Subclasses to override slot attributes.")
          "This class should throw an error.")))
 
   ;; Initform should override instance allocation
-  (let ((obj (slotattr-ok "moose")))
+  (let ((obj (slotattr-ok)))
     (should (eq (oref obj initform) 'no-init))))
 
 (defclass slotattr-class-base ()
@@ -794,7 +794,7 @@ Subclasses to override slot attributes.")
   (should (eq (oref-default slotattr-class-ok initform) 'no-init)))
 
 (ert-deftest eieio-test-32-slot-attribute-override-2 ()
-  (let* ((cv (class-v 'slotattr-ok))
+  (let* ((cv (eieio--class-v 'slotattr-ok))
         (docs   (eieio--class-public-doc cv))
         (names  (eieio--class-public-a cv))
         (cust   (eieio--class-public-custom cv))
@@ -825,7 +825,7 @@ Subclasses to override slot attributes.")
 
 (ert-deftest eieio-test-32-test-clone-boring-objects ()
   ;; A simple make instance with EIEIO extension
-  (should (setq eitest-CLONETEST1 (make-instance 'class-a "a")))
+  (should (setq eitest-CLONETEST1 (make-instance 'class-a)))
   (should (setq eitest-CLONETEST2 (clone eitest-CLONETEST1)))
 
   ;; CLOS form of make-instance
@@ -839,7 +839,7 @@ Subclasses to override slot attributes.")
 
 (ert-deftest eieio-test-33-instance-tracker ()
   (let (IT-list IT1)
-    (should (setq IT1 (IT "trackme")))
+    (should (setq IT1 (IT)))
     ;; The instance tracker must find this
     (should (eieio-instance-tracker-find 'die 'slot1 'IT-list))
     ;; Test deletion
@@ -851,8 +851,8 @@ Subclasses to override slot attributes.")
   "A Singleton test object.")
 
 (ert-deftest eieio-test-34-singletons ()
-  (let ((obj1 (SINGLE "Moose"))
-       (obj2 (SINGLE "Cow")))
+  (let ((obj1 (SINGLE))
+       (obj2 (SINGLE)))
     (should (eieio-object-p obj1))
     (should (eieio-object-p obj2))
     (should (eq obj1 obj2))
@@ -865,7 +865,7 @@ Subclasses to override slot attributes.")
 
 (ert-deftest eieio-test-35-named-object ()
   (let (N)
-    (should (setq N (NAMED "Foo")))
+    (should (setq N (NAMED :object-name "Foo")))
     (should (string= "Foo" (oref N object-name)))
     (should-error (oref N missing-slot) :type 'invalid-slot-name)
     (oset N object-name "NewName")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]