[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some easy ones (?)
- To: NGALL@G.BBN.COM, common-lisp@SU-AI.ARPA
- Subject: Re: Some easy ones (?)
- From: David C. Plummer <DCP@QUABBIN.SCRC.Symbolics.COM>
- Date: Fri, 25 Jul 86 12:01 EDT
- Cc: Fahlman@C.CS.CMU.EDU
- In-reply-to: <[G.BBN.COM]24-Jul-86 15:29:46.NGALL>
Date: 24 Jul 1986 15:29-EDT
Yes. PARSE-BODY called with DECLARATIONS-ALLOWED-P of NIL would be
used to verify that an implicit PROGN does not begin with decls (it
could be used with 'bodies' other than implicit PROGNs, but only if
such bodies do not allow a declaration-like syntax (unlike CASE and
COND (boy, did I pick a bad example!)).
Yes. Its contract would be to make sure there aren't any declarations.
This was the point I was trying (and failing so miserably) to make.
PARSE-BODY currently has no contract to make sure declarations are only at
the beginning. To do so it might have to expand macros (needlessly).
Therefore it isn't suitable for your intent of using it to verify
implicit PROGNs. Consider
(declare (inline xyzzy))
which is illegal. PARSE-BODY is for parsing bodies. Period. Implicit
PROGNs are not bodies. Really. PARSE-BODY's contract should be simple:
extract the three components of a body: the declarations, the
documentation, and the implicit PROGN. That is what a body is.
Something that isn't that isn't a body.