On this page:
Keyword
Keyword.from_  string
Keyword.from_  symbol
8.12

6.27 Keywords🔗ℹ

A keyword by itself does not work as an expression, but keywords exist as values, and the #' operator can produce a keyword value. Keywords are always interned, and they are equal by == only when they are equal by ===.

See also #', which works for keywords as well as symbols.

Keywords are comparable, which means that generic operations like < and > work on keywords. Comparsion of two keywords is the same as comparing the string forms of the keywords.

annotation

Keyword

Matches keyword values.

Converts a string or symbol to a keyword with the same character content, not counting a keyword’s leading ~.

> Keyword.from_string("apple")

#'~apple

> Keyword.from_symbol(#'apple)

#'~apple