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

Re: Compiler Warning from MAKE-PARAMETER-REFERENCES



    Date: 15 Dec 88 19:09 PST
    From: cutting.pa

      From: goldman@vaxa.isi.edu

      Can someone explain the following warning issued when I compile
      the DEFMETHOD form below?

      "Warning (not associated with any definition):
	In defmethod M23 (TEST23), there is a
	redundant ignore declaration for the parameter X."

      (defmethod m23 ((x test23)) (declare (ignore x)) 7)

    The CLOS spec says: "The expansion of the DEFMETHOD macro 'refers
    to' each specialized parameter."  (p 2-40)  Thus it's wrong to
    (declare (ignore ...)) any such parameter.

    My guess is that in this case PCL implements your method body as a
    function with one argument, X, declared to be ignored as method
    dispatch has already happened by the time it is called, and your
    method body was noticed to not reference X.  Your further
    declaration caused the compiler to complain of redundant ignore
    declarations, as indeed there were two. 

Almost right.  Actually, PCL itself issues that warning.  There is some
question as to whether it should issue the warning or silently remove
the redundant warning.  I made it warn to help remind people that they
didn't need to type those declares.
-------