Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Keywords

Keyword arguments are specified by #: syntax:

(define (add #:first first #:second second)
  (+ first second))

Optional keywords can also be specified by [arg-id val],

(define (add #:first [first 0] #:second [second 0])
  (+ first second))

Here is another example with a variadic definition.

(define (add #:first [first 0] . args)
  (apply + (cons first args)))