Keywordp
Recognizer for keywords
(Keywordp x) is true if and only if x is a keyword, i.e.,
a symbol in the "KEYWORD" package. Such symbols are typically printed using
a colon
(:) followed by the symbol-name of the symbol.
Keywordp has a guard of t.
Keywordp is a Common Lisp function. See any Common Lisp documentation
for more information. The following log may be illuminating.
ACL2 !>(intern "ABC" "KEYWORD")
:ABC
ACL2 !>(symbol-name ':ABC)
"ABC"
ACL2 !>(symbol-package-name ':ABC)
"KEYWORD"
ACL2 !>
Function: keywordp
(defun keywordp (x)
(declare (xargs :guard t))
(and (symbolp x)
(equal (symbol-package-name x)
"KEYWORD")))
Subtopics
- Keyword-value-listp
- Recognizer for true lists whose even-position elements are keywords
- Keyword-listp
- Recognizer for true lists of keywords
- Nonkeyword-listp
- Recognize lists of non-keywords.