Elisp: Keyword Symbol (Colon Prefix)

By Xah Lee. Date: . Last updated: .

What is Keyword Symbol

A symbol that start with a colon (:) is a keyword symbol.

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

Reference

Elisp, symbol