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

Re: Proposal #6 Status: Parsing in &BODY

It was unclear to me whether you are for the &body extension, against
it, or have an alternative to propose.

I don't think anyone was proposing that

(defmacro defun (name bvl &body body)

would call parse-body. Only

(defmacro defun (name bvl &body body decls)

would call parse-body.

I suggest rephrasing Proposal #6A to removing the reference to
"parse-body", since there's some disagreement about what that function
might be. E.g.:

Proposal #6A':

Extend the syntax of an &BODY parameter to DEFMACRO to allow writing
(DEFMACRO name (... &BODY body-var [declarations-var [doc-string-var]])

If declarations-var  is present, then, the original body is parsed,
looking for declarations and, when doc-string-var is present, for
documentation strings. Body-var is bound to the remaining body, while
declarations-var is bound to a list of (declare ...) forms and (when
present) doc-string-var to the first documentation string found. 

During the course of processing the original body, macros are expanded
to see if they expand into declarations, although the macro expansion
itself is not kept if no declarations are found. Note that a
documentation string cannot be the @i[last] element in a body, according
to the syntax on p. xxx.