Whoops, I should've read the docs more closely. You can specify your own default values for unspecified keywords:
> (define (my-func #!key (bool-arg 'unspecified)) (if (eq? bool-arg 'unspecified) "bool-arg unspecified" bool-arg))
> (my-func)
"bool-arg unspecified"
> (my-func bool-arg: #t)
#t
> (my-func bool-arg: #f)
#f
Sorry for the spam,
-- Matt
When a keyword argument is left unspecified, it is initialized to #f. This can get weird for optional boolean arguments. For example:
Example:
> (define (my-func #!key bool-arg) (if bool-arg bool-arg "bool-arg unspecified"))
> (my-func bool-arg: #t)
#t
> (my-func)
"bool-arg unset"
> (my-func bool-arg: #f)
"bool-arg unset"
Is there any way to distinguish between keyword arguments that were never set, and keyword arguments that were set to #f?