Next: , Previous: filter-declaration-env, Up: API



— Function: map-declaration-env function declaration-env ⇒ result-env

Arguments and Values

A function designator for a function with three arguments.
A declaration-env.
A fresh declaration-env.


The function map-declaration-env maps function over declaration-env in the following way: function is called for each declaration specifier in declaration-env with the parts (cf. analyze-declaration-specifier) of that specifier. function should either return new values for the parts, or return the same values.

If new values are returned for an unknown declaration specifier, the specifier ceases to be considered unknown in result-env.

map-declaration-env cannot be used to filter particular entries of declaration-env away.

Exceptional Situations

Signals an error of type TYPE-ERROR if function is not a function designator, or declaration-env is not a declaration-env.

See Also



map-declaration-env is provided to let users of the library Parse-Declaration customize the way declaration specifiers are parsed in arbitrary ways that scale even when multiple applications use Parse-Declarations in the same Lisp image.

Users can extend the set of understood declaration specifiers by adding methods on analyze-declaration-specifier and build-declaration-specifier. These methods ought to specialize on the declaration identifier with an EQL specializer. The package machinery will ensure that no conflict will arise between multiple applications in the same Lisp image.

If users want to customize the behaviour beyond that (for example parsing a standard declaration specifier in a different way), they should locally use map-declaration-env on the result of parse-declarations.