Next: check-declaration-env, Previous: build-declaration-specifier, Up: API
The function build-declarations constructs all the declarations that are stored in each
of the declaration-envs. The symbol tag is used as
the first element of these declarations. If tag is NIL
, build-declarations returns a list of declaration specifiers rather than
declarations.
The order of the returned expressions is not specified; in particular, the order doesn't have to be in any relation with the order of declarations that parse-declarations has been invoked with to create one of declaration-envs.
Furthermore, declarations-or-specifiers may share structure with the declaration specifiers that were initially passed to parse-declarations.
PARSE-DECLARATIONS> (defparameter *env* (parse-declarations '((declare (optimize speed)) (declare (fixnum x y)) (declare (inline +))))) => *ENV* PARSE-DECLARATIONS> (build-declarations 'declare *env*) => ((DECLARE (INLINE +)) (DECLARE (TYPE FIXNUM X Y)) (DECLARE (OPTIMIZE SPEED))) PARSE-DECLARATIONS> (build-declarations nil *env*) => ((TYPE FIXNUM X Y) (INLINE +) (OPTIMIZE SPEED))
Signals an error of type TYPE-ERROR
if tag is not a
symbol, or if any declaration-env is not a declaration-env.