Checking consistency between class slots
Posted: Sun May 22, 2011 6:52 am
Hi,
I want to check that the value of a slot in a class (defined when the class is created) is appropriate based on the values of other slots (e.g., in the example below that the value val is within the range of min and max) and to produce an error if this is not the case. I've not been able to find a solution so far. I'd be very grateful for advice. Thank you.
(defclass foo ()
((min :initarg :min)
(max :initarg :max)
(val :initarg :val))
I want to check that the value of a slot in a class (defined when the class is created) is appropriate based on the values of other slots (e.g., in the example below that the value val is within the range of min and max) and to produce an error if this is not the case. I've not been able to find a solution so far. I'd be very grateful for advice. Thank you.
(defclass foo ()
((min :initarg :min)
(max :initarg :max)
(val :initarg :val))