[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eql-specialized methods and before
- To: firstname.lastname@example.org
- Subject: Re: eql-specialized methods and before
- From: "Mark A. Tapia" <email@example.com>
- Date: Fri, 11 Feb 1994 15:40:02 -0500
- Cc: firstname.lastname@example.org
On Fri Feb 111994 Bob Hall writes:
> Is the following a bug, or am I doing something wrong? It works okay
> if I don't define the :BEFORE method.
> (DEFMETHOD ZOG ((X (EQL :NORJ))) (print "Zognorj!"))
> (DEFMETHOD ZOG ((X (EQL :BLID))) (PRINT "Zogblid!"))
> (DEFMETHOD ZOG :BEFORE ((X T)) (PRINT "Before zog"))
> (ZOG :NORJ)
>> Error: No applicable primary methods for #<STANDARD-GENERIC-FUNCTION ZOG
>> Applicable methods: (#<STANDARD-METHOD ZOG :BEFORE (T)>)
>> While executing: CCL::%METHOD-COMBINATION-ERROR
>> Type Command-. to abort.
If you're going to use a before, after, or around methods (e.g.
(defmethod zog :before ...
(defmethod zog :after ...
(defmethod zog :around ...
you'll need to define a primary method The :before method is invoked before
any other method, the after method after.
The problems disappear if you add the following
(defmethod zog ((x t))
(declare (ignore x)
Then it works correctly
? (ZOG :NORJ)
If you add an after method
(defmethod zog :after ((x t)) (print :after) t)
? (ZOG :NORJ)