name - a symbol.
package-list-form - a form; evaluated once to produce a package-list.
package-list - a designator for a list of package designators.
symbol-type - one of the symbols
:internal, :external, or :inherited.
declaration - a declare expression; not evaluated.
forms - an implicit progn.
results - the values of the forms.
Within the lexical scope of the body forms,
the name is defined via macrolet
such that successive invocations of (name)
will return the symbols, one by one,
from the packages in package-list.
It is unspecified whether symbols inherited from
multiple packages are returned more than once.
The order of symbols returned does not necessarily reflect the order
of packages in package-list. When package-list has
more than one element, it is unspecified whether duplicate symbols are
returned once or more than once.
Symbol-types controls which symbols that are accessible
in a package are returned as follows:
When more than one argument is supplied for symbol-types,
a symbol is returned if its accessibility matches
any one of the symbol-types supplied.
Implementations may extend this syntax by recognizing additional
symbol accessibility types.
An invocation of (name) returns four values as follows:
- 1. A flag that indicates whether a symbol is returned
(true means that a symbol is returned).
- 2. A symbol that is accessible in one the
- 3. The accessibility type for that symbol;
i.e., one of the symbols :internal, :external, or :inherited.
- 4. The package from which the symbol was obtained.
The package is one of the packages present
or named in package-list.
After all symbols have been returned by successive invocations of
(name), then only one value is returned, namely nil.
The meaning of the second, third, and fourth values is that the returned
symbol is accessible in the returned package
in the way indicated by the second return value as follows:
It is unspecified what happens if any of the implicit interior state
of an iteration is returned outside the dynamic extent of the
form such as by returning some closure over the invocation form.
Any number of invocations of with-package-iterator
can be nested, and the body of the innermost one can invoke all of the
locally established macros, provided all those macros
have distinct names.