2015-01-17 Stefan Monnier <monnier@iro.umontreal.ca>
+ * emacs-lisp/eieio-core.el (eieio--class-constructor): Rename from
+ class-constructor, and make it an alias for `identity'.
+ Update all callers.
+
* emacs-lisp/eieio.el (eieio-constructor): Handle obsolete object name
argument here (bug#19620)...
(defclass): ...instead of in the constructor here.
(format "#<class %s>" (symbol-name class)))
(define-obsolete-function-alias 'class-name #'eieio-class-name "24.4")
-(defmacro class-constructor (class)
- "Return the symbol representing the constructor of CLASS."
- (declare (debug t))
- ;; FIXME: How/when would this not be a costly identity function?
- `(eieio--class-symbol (eieio--class-v ,class)))
+(defalias 'eieio--class-constructor #'identity
+ "Return the symbol representing the constructor of CLASS.")
(defmacro eieio--class-option-assoc (list option)
"Return from LIST the found OPTION, or nil if it doesn't exist."
(if (not (widget-get widget :value))
(widget-put widget
:value (cond ((widget-get widget :objecttype)
- (funcall (class-constructor
+ (funcall (eieio--class-constructor
(widget-get widget :objecttype))
"Custom-new"))
((widget-get widget :objectcreatefcn)
"Name: ")
(let* ((cl (eieio-object-class obj))
(cv (eieio--class-v cl)))
- (data-debug-insert-thing (class-constructor cl)
+ (data-debug-insert-thing (eieio--class-constructor cl)
prefix
"Class: ")
;; Loop over all the public slots
`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."
- (apply (class-constructor class) initargs))
+ (apply (eieio--class-constructor class) initargs))
\f
;;; Get/Set slots in an object.
;; Each slot's slot is writen using its :writer.
(princ (make-string (* eieio-print-depth 2) ? ))
(princ "(")
- (princ (symbol-name (class-constructor (eieio-object-class this))))
+ (princ (symbol-name (eieio--class-constructor (eieio-object-class this))))
(princ " ")
(prin1 (eieio-object-name-string this))
(princ "\n")