Elisp: Keyword Symbol (Colon Prefix)
What is Keyword Symbol
A symbol that start with a colon (:) is a keyword symbol.
- Keyword symbols are often used as Function Keyword Parameters (Named Parameters), or as keys for Hash Table.
- Keyword symbols are constants. They evaluate to themselfs. (called self-evaluating) They cannot be set.
Keyword Symbol Needs Not be Quoted
keyword symbol eval to itself, it does not need to be quoted.
(symbolp :my-some) ;; t
Check is keyword symbol
keywordp-
(keywordp OBJECT)returns t if OBJECT is a symbol whose name starts with colon : and interned in the standard obarray. else
nil.(keywordp :abc) ;; t (keywordp 'abc) ;; nil