Stop show with sound -- Keyboard shortcut: 'x'  Next slide in show -- Keyboard shortcut: 'n'  1 minute, 14 secondsExpressions, Types, and Functions - slide 40 : 46

Optional parameters of Scheme functions (1)

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)))
A number of calls of the function f.