Constructor
Frank <[email protected]> Sat, 29 May 2010 13:23:32 -0600
| Newsgroups | gmane.emacs.eieio |
|---|---|
| Message-ID | <[email protected]> |
Hi there,
I have a question regarding constructors.
I'm fairly new to EIEIO and Emacs but I was wondering how to do this:
Lets say I have this class:
(defclass foo ()
((size :initarg :size
:type wholenum)
(vec :initform (make-vector size nil)
:protection :protected)))
Which embed's a vector.
My question is how do I get VEC initialized. This code obviously
doesn't work. Can I somehow reference the previously initialized
arguments (in this case SIZE) in an initform?
Is it possible to write my own constructor which executes before the
default constructor like this?
(defmethod foo :before :static ((obj foo) &rest args)
)
Thanks
------------------------------------------------------------------------------