Hi,
I have a class which is defined like this (basically, wraps a pointer):
(defclass x-display () ((display-pointer :initform (null-pointer) :initarg :display-pointer :documentation "pointer to an Xlib display structure")))
For convenience, I would like to use it in place of a pointer, with some extra error checking:
(defmethod translate-to-foreign (value (type (eql 'x-display))) (with-slots (display-pointer) value (when (null-pointer-p display-pointer) (error "the X11 display is not open")) display-pointer))
But this doesn't work: functions complain that they expect a system-area-pointer (I am in SBCL), so this method is not called.
What am I doing wrong?
Thanks,
Tamas