Next: parse-declarations, Previous: merge-declaration-envs, Up: API
The function parse-body splits an &BODY argument of an
extended lambda list into its three
distinctive parts which are returned as multiple values:
A documentation string is only parsed if documentation is true. whole is used to indicate the context if an error is signalled, and should hence be a symbol naming the operator parse-body is used to define.
PARSE-DECLARATIONS> (parse-body '("Also sprach Zarathustra.."
(declare (optimize speed))
(declare (author "God"))
(setf *universe* (big-bang))
(frob-light))
:documentation t)
=> ((SETF *UNIVERSE* (BIG-BANG)) (FROB-LIGHT))
=> ((DECLARE (OPTIMIZE SPEED)) (DECLARE (AUTHOR "God")))
=> "Also sprach Zarathustra.."
Signals an error of type SIMPLE-ERROR if
body-and-decls contains more than one documentation string, and documentation is
true.
The symbol PARSE-BODY is not exported from the library Parse-Declarations to
avoid a name conflict with the Alexandria library. However, this symbol is guaranteed to be part of Parse-Declarations, and can
hence be referenced directly, or imported explicitly, if users don't want to use Alexandria.