Expressions, Types, and Functions
- slide 41 : 46
Optional parameters of Scheme functions (2)
Observations about optional parameters:
The function
optional-parameter
is a LAML function from the general library
The optional parameter idea works well if there is a natural ordering of the relevance of the parameters
If parameter
n
is passed, it is also natural to pass parameter
1
to
n-1
The idea does not work well if we need to pass optional parameter number
n
, but not number
1
..
n-1
Keyword parameters is a good alternative to optional parameter lists in case many, 'unordered' parameters need to passed to a function