Declaration question

From: Yang, Chul-Woong (cwyang_at_aratech.co.kr)
Date: 02/26/04


Date: Thu, 26 Feb 2004 05:42:54 GMT

Hi.

I'm reading 'OOP in CL' by S.Keene.
At chapter 11, She wrote code like belows.

(defclass....)
...
(defgeneric read-next-element (input-stream)
  (declare (values element eof-p))
   ...

and she describes above 'declare' as
"You will notice that we declare the returned values of generic
functions in several defgeneric forms. This is a convenient way to
document part of the contract of the generic function - the expected
returned values. Although CL does not specify 'values' as a recognized
declaration specifier, we can make it one by proclaiming 'values' as a
declaration as follows:
  (proclaim '(declaration values))
"

With my limited study, above declare statements seems to do nothing
particluar, because 9.2 of CLTL2 said 'declaration' means nonstandard
declaration name and just used in supressing compiler warnings.
Then, is above declaration just for documenting reason?
Or CL can generate warnings if programmer forget returning value in
method read-next-element?
Am I missing something? Any insights will be grateful. TIA.

Yang, Chul-Woong
cwyang@aratech.co.kr