On this page:
keyword-apply*

16 Keyword utilities

 (require (planet untyped/unlib/keyword))
Utilities for use with keywords and keyword procedures.

(keyword-apply* proc arg ... rest)  any
  proc : procedure?
  arg : any
  rest : list?
A more humane version of keyword-apply, where the arguments are specified in a similar order to a regular procedure call. Keywords should be quoted.

Examples:

  > (define (test #:a [a 1] b . rest)
      (list a b rest))
  > (keyword-apply* test null)

  procedure test: expects at least 1 argument plus an

  optional argument with keyword #:a, given 0

  > (keyword-apply* test 2 3 4 5 null)

  (1 2 (3 4 5))

  > (keyword-apply* test (list 2 3 4 5))

  (1 2 (3 4 5))

  > (keyword-apply* test '#:a 123 456 null)

  (123 456 ())

  > (keyword-apply* test 456 (list '#:a 123))

  (123 456 ())