Macro | Package: system | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## define-declaration

Arguments: namespec lambda-list prop kind &optional def

This macro defines a handler for the declaration named by namespec. augment-environment uses the information provided by this macro when processing declarations.

The arguments are:

- namespec is either a single name, or else it is a list which allows classes of declarations (an example of this is the inline and notinline declaration, which, when returned from a function-information call is either the value `(inline inline)` or `(inline notinline)`. This classification allows proper shadowing of declarations as they are propagated into inward contours, so that for example a free inline declaration will shadow any other notinline declaration by virtue of its presence as the first declaration of the inline class to be found.
- lambda-list is a simple lambda list. The only lambda-list keywords recognized are &optional and &rest. The "arguments" for the declaration specifier are implied by the whole lambda list, which is useful for recasting the declaration by either extracting one or more individual declarations from the declaration specifier, or putting multiple declarations together.
- prop allows a symbol to be defined (it should not be a keyword, nor should it be exported or accessible from the user package) to use as a property indicator. This is for global declarations which will either be attached to the environment, or in the case of the null environment it will serve as a property indicator for the name globally. The value `nil` can be given for this argument, in which case declarations in the global environment are ignored, and augment-environment to a global environment silently ignores that declaration.
- kind is one of `:variable`, `:function`, `:both`, or `:declare`. It determines how the declaration is treated, and the first value returned from the parsing function defined by define-declaration.
- If def is given it can be either a symbol or a lambda expression of two arguments, receiving the declaration and the current environment. If def is a symbol it is taken to be the name of an already-defined function which is of the same two arguments. If def is not provided or is `nil`, a function is created with default actions, which assumes the declaration is to be of the form `(decl name1 name2 ... nameN)`. If the body is specified, it must return two values, according to the definition in CLtL-2 p 213 (with the two exceptions that kind might be :both, which follows the same rules for both :variable and :function, and also if the kind is :declare, the list returned is a list of (list key value) instead of the cons that is specified there, to ease the consistency of the implementation).

See environments.htm for more information on environments.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version