40 seconds | Expressions, Types, and Functions - slide 40 : 46 |
It is often useful to pass one or more optional parameters to a function
In case an optional parameter is not passed explicitly, a default value should apply
(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)))