From: Ralitsa
Subject: CLOS problem
Date: 
Message-ID: <96957557.0305211202.68c248c2@posting.google.com>
Hello to all of you! I have the following problem: suppose I have defined
a class Geometric

 (defclass Geometric ()
   ((color :accessor color :initform 'black))
   (:documentation "The basic class for all graphical objects.Slot:
Color")) 

I want to define a before and after methods that are suppose to
show the color right before/after changing it. I tried the following code:

(defgeneric set_color ((new_color list) (obj Geometric))
   (:method ((new_color list)(obj Geometric)) (setf (color obj) new_color)
))
 (defmethod set_color :before ((new_value list) (obj Geometric))
  (print 'before (color obj))
  )

 but the interpreter comes up with an error:


 USER(37):  (set_color 'black g) Error: No methods applicable for generic
function
       #<STANDARD-GENERIC-FUNCTION SET_COLOR> with args
       (BLACK #<GEOMETRIC @ #x2039cd0a>) of classes (SYMBOL GEOMETRIC)
  [condition type: PROGRAM-ERROR]


 Any idea why or where is the mistake?
Thank you in advance...
From: Coby Beck
Subject: Re: CLOS problem
Date: 
Message-ID: <bah5ip$1u8$1@otis.netspace.net.au>
"Ralitsa" <···@abv.bg> wrote in message
·································@posting.google.com...
> Hello to all of you! I have the following problem: suppose I have defined
> a class Geometric

Hi Ralitsa,

I understand your problem may be urgent, but it isn't better to ask the same
question 3 times!

-- 
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")