(define (f rp . optional-parameter-list)
(let ((op1 (optional-parameter 1 optional-parameter-list 1))
(op2 (optional-parameter 2 optional-parameter-list "a"))
(op3 (optional-parameter 3 optional-parameter-list #f)))
(list rp op1 op2 op3))) |
| | A example of a function f that accepts optional-parameters. Besides the required parameter rp, the function accepts an arbitrary number of additional parameters,
the list of which are bound to the formal parameter optional-parameter-list. The function optional-parameter
from the LAML general library accesses information from optional-parameter-list. In case an optional parameter
is not passed, the default value (the last parameter of optional-parameter) applies.
|