A specifier for a rest parameter (original) (raw)

ANSI Common Lisp 3 Evaluation and Compilation 3.4 Lambda Lists 3.4.1 Ordinary Lambda Lists

3.4.1.3 A specifier for a rest parameter

&rest, if present, must be followed by a single rest parameterspecifier, which in turn must be followed by another lambda list keyword or the end of the lambda list. After all optional parameter specifiers have been processed, then there may or may not be a rest parameter. If there is a rest parameter, it is bound to a list of all as-yet-unprocessed arguments. If no unprocessed arguments remain, the rest parameter is bound to theempty list. If there is no rest parameter and there are no keyword parameters, then an error should be signaled if any unprocessed arguments remain; see Section 3.5 Error Checking in Function Calls. The value of a _rest parameter_is permitted, but not required, to share structure with the last argument to apply.