I am using 'eieio
and 'cl-lib
and I'm trying to define the object-print
method for my class as described here:
https://www.gnu.org/software/emacs/manual/html_mono/eieio.html#Basic-Methods
(cl-defmethod object-print ((this data-object) &optional strings)
"Return a string with a summary of the data object as part of the name."
(apply #'cl-call-next-method this
(format " value: %s" (render this))
strings))
I want to do this so I can see the contents of my object instances when I'm using edebug.
When I implement this example in my own code it produces the error message the function ‘render’ is not known to be defined
.
In addition to the error message, Flycheck suggests: ‘object-print’ is an obsolete generic function (as of 26.1); use ‘cl-print-object’ instead.
I cannot find any documentation on the cl-print-object
function when I Google, and I am failing at guessing how to implement it:
(cl-defmethod cl-print-object ((this card) &optional strings)
"Return a string with a summary of the data object as part of the name."
(apply #'cl-call-next-method this
(format " value: %s" (slot-value this 'value))
strings))
I do not know what to provide instead of (slot-value this 'value)
. It does not seem to want a slot.
How can I implement the cl-print-object
function? Or is there a better way to see the contents of an EIEIO object instance when debugging inside edebug?