Next: parse-body, Previous: map-declaration-env, Up: API
The function merge-declaration-envs returns the union of the declaration specifiers in declaration-env1 and declaration-env2 as a new declaration-env. There is no attempt made at removing duplicates, or at any other kind of normalization.
PARSE-DECLARATIONS> (defparameter *env* (parse-declarations '((declare (optimize speed))
(declare (fixnum x y))
(declare (inline +)))))
=> *ENV*
PARSE-DECLARATIONS> (defparameter *env2* (parse-declarations '((declare (type fixnum y z))
(declare (notinline +))
(declare (optimize (safety 3))))))
=> *ENV2*
PARSE-DECLARATIONS> (build-declarations 'declare (merge-declaration-envs *env* *env2*))
=> ((DECLARE (NOTINLINE +))
(DECLARE (INLINE +))
(DECLARE (TYPE FIXNUM X Y))
(DECLARE (TYPE FIXNUM Y Z))
(DECLARE (OPTIMIZE SPEED))
(DECLARE (OPTIMIZE (SAFETY 3))))
Signals an error of type TYPE-ERROR if
declaration-env1 or declaration-env2 is not a declaration-env.