[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: no describe?
- To: missing@inch.com (Ken Tilton)
- Subject: Re: no describe?
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Thu, 13 Apr 1995 13:39:25 -0400
- Cc: info-mcl@digitool.com
- Sender: owner-info-mcl@digitool.com
At 11:39 AM 4/13/95, Ken Tilton wrote:
>Following Keene, I attempted to define a "describe" method for my class. I
>see from the error that "describe" is not a generic function. Is there some
>other method I override to achieve the same end:controlling the appearance
>of raw object descriptions?
The generic function you can specialize is called describe-object.
describe is a regular function that calls describe-object.
? (defclass frob ()())
#<STANDARD-CLASS FROB>
? (defmethod describe-object ((frob frob) stream)
(format stream "~s is a frob." frob))
#<STANDARD-METHOD DESCRIBE-OBJECT (FROB T)>
? (describe (make-instance 'frob))
#<FROB #x1C3F039> is a frob.
?