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

Proposal #5 (aside)



    Since when can macros expand into documentation strings?

My reading of the manual on this point may be faulty or perhaps
"rabbinical", but here is what I think the book says:

On page 154, it says that it is permissible for a macro call to expand
into a declaration and be recognized as such, provided that the macro
call appears where a declaration may legitimately appear.

On page 67 it says that declarations may follow a doc string.

Suppose you have

(defun foo (...)
  (MACRO1 ...)
  (MACRO2 ...)
  ... more forms...)

Suppose MACRO1 expands into a string and MACRO2 expands into a DECLARE
form.  If we expand MACRO1 and get a string, I would say that this is
the documentation string and we should then expand MACRO2 to see if it
is a declaration, since it is in a place where a declaration may
legitimately appear.  That seems like the most reasonable interpretation
to me.  I agree that we could say that a string obtained from a leading
MACRO is not allowed to be a doc-string, in which case it is a body form
and we can stop looking for macros.

The book doesn't seem to come down on one side or the other.  Note,
however, that it is allowed to expand all the macros at defun time (some
implementations actually do this), and in that case my interpretation
would fall out automatically unless special care is taken to disallow
this.

-- Scott