Re: CLOS Question - Making an object a constant
- From: "skamboj" <skamboj@xxxxxxxxx>
- Date: 29 Jun 2006 09:53:22 -0700
Thanks for your reply...
I have been really meaning to read up on the MOP for quite some time
now. Do you have any good references that you would recommend?
Thanks once again...
Regards,
Sachin.
You could trap it with something like this:
(asdf:oos 'asdf:load-op :closer-mop)
(defmethod closer-mop:slot-makunbound-using-class :after
(class (object (eql *constant-object*)) slot-definition)
(declare (ignore class))
(when (eql 'constant-slot (closer-mop:slot-definition-name slot-definition))
(error "Made unbound the constant slot ~A of the constant object ~A"
'constant-slot object))
object)
(defmethod (setf closer-mop:slot-value-using-class) :after
(new-value class (object (eql *constant-object*)) slot-definition)
(when (eql 'constant-slot (closer-mop:slot-definition-name slot-definition))
(error "Assigned to the constant slot ~A of the constant object ~A"
'constant-slot object))
new-value)
.
- Follow-Ups:
- Re: CLOS Question - Making an object a constant
- From: Pascal Costanza
- Re: CLOS Question - Making an object a constant
- References:
- CLOS Question - Making an object a constant
- From: skamboj
- Re: CLOS Question - Making an object a constant
- From: Pascal Bourguignon
- CLOS Question - Making an object a constant
- Prev by Date: Re: CLOS Question - Making an object a constant
- Next by Date: Re: Why is LISP syntax superior?
- Previous by thread: Re: CLOS Question - Making an object a constant
- Next by thread: Re: CLOS Question - Making an object a constant
- Index(es):