Q: can one symbol refer to a function, a variable, and a class?
Elisp is a Lisp-2 in which a symbol can have separate function and variable values. So, for example, I can define the following function and variable:
(defun kittens ()
"Profess love of kittens."
(message "I love kittens!"))
(defvar kittens nil
"A variable to store information about kittens.")
And query their respective contents:
(symbol-value 'kittens) ; => nil
(symbol-function 'kittens) ; => (lambda nil "Profess love...")
However, once I define a class with the same name:
(defclass kittens ()
((quantity
:initarg :quantity
:initform 1000
:accessor kittens-quantity
:documentation "How many kittens anyone should strive to own."))
"Kitten class.")
The class appears to supercede the function and the variable:
(symbol-value 'kittens) ; => kittens
(symbol-function 'kittens) ; => (lambda (&rest slots) "Create a new object...")
So: do classes simply clobber the original function and variable, or do the original values still exist somewhere?