Next: , Previous: build-declaration-specifier, Up: API


build-declarations

Syntax

— Function: build-declarations tag &rest declaration-envs+ ⇒ declarations-or-specifiers

Arguments and Values

tag
A symbol.
declaration-env
A declaration-env
declarations-or-specifiers
Either a list of declarations, or a list of declaration specifiers.

Description

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.

Examples

  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))

Exceptional Situations

Signals an error of type TYPE-ERROR if tag is not a symbol, or if any declaration-env is not a declaration-env.

See Also

build-declaration-specifier
parse-declarations