(guile.info.gz) Optional Arguments
Info Catalog
(guile.info.gz) Lambda
(guile.info.gz) Procedures and Macros
(guile.info.gz) Procedure Properties
23.2 Optional Arguments
=======================
Scheme procedures, as defined in R5RS, can either handle a fixed number
of actual arguments, or a fixed number of actual arguments followed by
arbitrarily many additional arguments. Writing procedures of variable
arity can be useful, but unfortunately, the syntactic means for handling
argument lists of varying length is a bit inconvenient. It is possible
to give names to the fixed number of argument, but the remaining
(optional) arguments can be only referenced as a list of values (
Lambda).
Guile comes with the module `(ice-9 optargs)', which makes using
optional arguments much more convenient. In addition, this module
provides syntax for handling keywords in argument lists (
Keywords).
Before using any of the procedures or macros defined in this section,
you have to load the module `(ice-9 optargs)' with the statement:
(use-modules (ice-9 optargs))
Menu
* let-optional Reference Locally binding optional arguments.
* let-keywords Reference Locally binding keywords arguments.
* lambda* Reference Creating advanced argument handling procedures.
* define* Reference Defining procedures and macros.
Info Catalog
(guile.info.gz) Lambda
(guile.info.gz) Procedures and Macros
(guile.info.gz) Procedure Properties
automatically generated byinfo2html