SRFI 227: Optional Arguments

by Marc Nieper-Wißkirchen (spec and R6RS implementation) and Daphne Preston-Kendal (R7RS implementation)

status: final (2021-11-16)

keywords: Binding

See also SRFI 89: Optional positional and named parameters.

Abstract

This SRFI specifies the opt-lambda syntax, which generalizes lambda. An opt-lambda expression evaluates to a procedure that takes a number of required and a number of optional (positional) arguments whose default values are determined by evaluating corresponding expressions when the procedure is called.

This SRFI also specifies a variation opt*-lambda, which is to opt-lambda as let* is to let and the related binding constructs let-optionals and let-optionals*.

Finally, for those who prefer less explicit procedure definitions, a sublibrary provides define-optionals and define-optionals*.