8.5.5. Keywords

Keywords are similar to symbols. The main difference is that keywords are self-evaluating and therefore do not need to be quoted in expressions. They are used mainly for specifying keyword arguments.

[75] keyword = identifier:

A keyword is a single token; therefore, no whitespace is allowed between the identifier and the :. The : is not considered part of the name of the keyword.

8.5.5.1. Keyword Type Predicate

(keyword? obj)

Returns #t if obj is a keyword, and otherwise returns #f.

8.5.5.2. Keyword to String Conversion

(keyword->string keyword)

Returns the name of keyword as a string.

EXAMPLE 44

(keyword->string Argentina:) ==> "Argentina"

8.5.5.3. String to Keyword Conversion

(string->keyword string)

Returns the keyword whose name is string.

EXAMPLE 45

(string->keyword "foobar") ==> foobar: