[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with eql method specifiers



I'm using the PCL version from 4/20/89 with Genera 7.2.  I have a few
problems with eql specifiers in methods.  Here is an example:

   (defclass test-superclass ()
        ())
   
   (defclass test-class (test-superclass)
        ())
   
   (defmethod test-eql ((self test-superclass) x)
     (format t "~&test-eql other"))
   
   (defmethod test-eql ((self test-class) (x (eql 'a)))
     (format t "~&test-eql a"))
   
   (defmethod test-eql ((self test-class) (x (eql 'b)))
     (format t "~&test-eql b"))
   
   > (setq i (make-instance 'test-class))
   
   > (test-eql i 'a)
   test-eql a
   
   > (test-eql i 'b)
   test-eql other         <------ this is wrong!
   
   > (test-eql i 'c)
   test-eql other

It works if the "other" method is defined in the same class.  

Another problem is that I can't compile the two methods "test-eql2";
the compiler runs into an error.  A method without an eql specifier
seems to be necessary.

   (defmethod test-eql2 ((self test-class) (x (eql 'a)))
     (format t "~&test-eql2 a"))
   
   (defmethod test-eql2 ((self test-class) (x (eql 'b)))
     (format t "~&test-eql2 b"))

I cannot access my PCL version from 12/7/88 right now so that I don't
know whether that version has the same problems.

Any help will be appreciated.

Andreas Girgensohn
andreasg@boulder.colorado.edu