8.15.0.12
7.5 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. Comparison of two keywords is the same as comparing the string forms of the keywords.
annotation | |
Matches keyword values.
function | |
| |
function | |
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