\f
;;; Important macros used internally in eieio.
-(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))
+(require 'cl-macs) ;For cl--find-class.
(defsubst eieio--class-object (class)
"Return the class object."
(if (symbolp class)
;; Keep the symbol if class-v is nil, for better error messages.
- (or (eieio--class-v class) class)
+ (or (cl--find-class class) class)
class))
(defun class-p (class)
"Return non-nil if CLASS is a valid class vector.
CLASS is a symbol." ;FIXME: Is it a vector or a symbol?
- (and (symbolp class) (eieio--class-p (eieio--class-v class))))
+ (and (symbolp class) (eieio--class-p (cl--find-class class))))
(defun eieio--class-print-name (class)
"Return a printed representation of CLASS."
(defun class-abstract-p (class)
"Return non-nil if CLASS is abstract.
Abstract classes cannot be instantiated."
- (eieio--class-option (eieio--class-v class) :abstract))
+ (eieio--class-option (cl--find-class class) :abstract))
(defsubst eieio--class-method-invocation-order (class)
"Return the invocation order of CLASS.
;; simply not exist yet. So instead we just don't store the list of parents
;; here in eieio-defclass-autoload at all, since it seems that they're just
;; not needed before the class is actually loaded.
- (let* ((oldc (eieio--class-v cname))
+ (let* ((oldc (cl--find-class cname))
(newc (eieio--class-make cname)))
(if (eieio--class-p oldc)
nil ;; Do nothing if we already have this class.
;; 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.
- (setf (eieio--class-v cname) newc)
+ (setf (cl--find-class cname) newc)
;; Create an autoload on top of our constructor function.
(autoload cname filename doc nil nil)
(run-hooks 'eieio-hook)
(setq eieio-hook nil)
- (let* ((oldc (let ((c (eieio--class-v cname))) (if (eieio--class-p c) c)))
+ (let* ((oldc (let ((c (cl--find-class cname))) (if (eieio--class-p c) c)))
(newc (or oldc
;; Reuse `oldc' instead of creating a new one, so that
;; existing references stay valid. E.g. when
(dolist (p superclasses)
(if (not (and p (symbolp p)))
(error "Invalid parent class %S" p)
- (let ((c (eieio--class-v p)))
+ (let ((c (cl--find-class p)))
(if (not (eieio--class-p c))
;; bad class
(error "Given parent class %S is not a class" p)
;; 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.
- (setf (eieio--class-v cname) newc)
+ (setf (cl--find-class cname) newc)
;; Query each slot in the declaration list and mangle into the
;; class structure I have defined.
(cl-check-type obj (or eieio-object class))
(let* ((class (cond ((symbolp obj)
(error "eieio-oref called on a class: %s" obj)
- (let ((c (eieio--class-v obj)))
+ (let ((c (cl--find-class obj)))
(if (eieio--class-p c) (eieio-class-un-autoload obj))
c))
(t (eieio--object-class obj))))
Fills in OBJ's SLOT with its default value."
(cl-check-type obj (or eieio-object class))
(cl-check-type slot symbol)
- (let* ((cl (cond ((symbolp obj) (eieio--class-v obj))
+ (let* ((cl (cond ((symbolp obj) (cl--find-class obj))
(t (eieio--object-class obj))))
(c (eieio--slot-name-index cl slot)))
(if (not c)
(defun eieio--class-precedence-c3 (class)
"Return all parents of CLASS in c3 order."
- (let ((parents (eieio--class-parents (eieio--class-v class))))
+ (let ((parents (eieio--class-parents (cl--find-class class))))
(eieio--c3-merge-lists
(list class)
(append
(defconst eieio--generic-subclass-generalizer
(cl-generic-make-generalizer
- 60 (lambda (name) `(and (symbolp ,name) (eieio--class-v ,name)))
+ 60 (lambda (name) `(and (symbolp ,name) (cl--find-class ,name)))
#'eieio--generic-subclass-specializers))
(cl-defmethod cl-generic-generalizers ((_specializer (head subclass)))
(list eieio--generic-subclass-generalizer))
\f
-;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "0609a7bdcd6f38876b7f5647047ddca9")
+;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "ea8c7f24ed47c6b71ac37cbdae1c9931")
;;; Generated autoloads from eieio-compat.el
(autoload 'eieio--defalias "eieio-compat" "\
Argument CH-PREFIX is another character prefix to display."
(cl-check-type this-root class)
(let ((myname (symbol-name this-root))
- (chl (eieio--class-children (eieio--class-v this-root)))
+ (chl (eieio--class-children (cl--find-class this-root)))
(fprefix (concat ch-prefix " +--"))
(mprefix (concat ch-prefix " | "))
(lprefix (concat ch-prefix " ")))
;; Header line
(prin1 class)
(insert " is a"
- (if (eieio--class-option (eieio--class-v class) :abstract)
+ (if (eieio--class-option (cl--find-class class) :abstract)
"n abstract"
"")
" class")
(defun eieio-help-class-slots (class)
"Print help description for the slots in CLASS.
Outputs to the current buffer."
- (let* ((cv (eieio--class-v class))
+ (let* ((cv (cl--find-class class))
(slots (eieio--class-slots cv))
(cslots (eieio--class-class-slots cv)))
(insert (propertize "Instance Allocated Slots:\n\n"
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 (eieio--class-v cc))))
+ (sublst (eieio--class-children (cl--find-class 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
(defun eieio-class-button (class depth)
"Draw a speedbar button at the current point for CLASS at DEPTH."
(cl-check-type class class)
- (let ((subclasses (eieio--class-children (eieio--class-v class))))
+ (let ((subclasses (eieio--class-children (cl--find-class class))))
(if subclasses
(speedbar-make-tag-line 'angle ?+
'eieio-sb-expand
(speedbar-with-writable
(save-excursion
(end-of-line) (forward-char 1)
- (let ((subclasses (eieio--class-children (eieio--class-v class))))
+ (let ((subclasses (eieio--class-children (cl--find-class class))))
(while subclasses
(eieio-class-button (car subclasses) (1+ indent))
(setq subclasses (cdr subclasses)))))))
"Return child classes to CLASS.
The CLOS function `class-direct-subclasses' is aliased to this function."
(cl-check-type class class)
- (eieio--class-children (eieio--class-v class)))
+ (eieio--class-children (cl--find-class class)))
(define-obsolete-function-alias
'class-children #'eieio-class-children "24.4")
"Return the class that SYMBOL represents.
If there is no class, nil is returned if ERRORP is nil.
If ERRORP is non-nil, `wrong-argument-type' is signaled."
- (let ((class (eieio--class-v symbol)))
+ (let ((class (cl--find-class symbol)))
(cond
((eieio--class-p class) class)
(errorp (signal 'wrong-type-argument (list 'class-p symbol))))))
This class is not stored in the `parent' slot of a class vector."
:abstract t)
-(setq eieio-default-superclass (eieio--class-v 'eieio-default-superclass))
+(setq eieio-default-superclass (cl--find-class 'eieio-default-superclass))
(defalias 'standard-class 'eieio-default-superclass)
(princ comment)
(princ "\n"))
(let* ((cl (eieio-object-class this))
- (cv (eieio--class-v cl)))
+ (cv (cl--find-class cl)))
;; Now output readable lisp to recreate this object
;; It should look like this:
;; (<constructor> <name> <slot> <slot> ... )
;;;***
\f
-;;;### (autoloads nil "eieio-opt" "eieio-opt.el" "899e10c7883c4aac5cefcc223794e8f9")
+;;;### (autoloads nil "eieio-opt" "eieio-opt.el" "b7995d9076e4dd4b9358b2aa66835619")
;;; Generated autoloads from eieio-opt.el
(autoload 'eieio-browse "eieio-opt" "\