Return true if x is a Keyword
(keyword? 'x) ;;=> false (keyword? :x) ;;=> true (keyword? true) ;;=> false ;; Note: some of the keywords below are non-conformant and will not work ;; with destructuring. For more info see 'keyword'. (keyword? :-) ;;=> true (keyword? :+) ;;=> true (keyword? :-o) ;;=> true (keyword? :') ;;=> true (keyword? :#) ;;=> true (keyword? :</>) ;;=> true (keyword? :'/-) ;;=> true (keyword? :'//-) ;;=> true (keyword? :////) ;;=> true (keyword? :'//-,) ;;=> true (keyword? :'//,-) ;;=> ArityException Wrong number of args (2) passed to: core/keyword? clojure.lang.AFn.throwArity (AFn.java:429) ;; Note: the comma is taken as space, so the code above is equivalent to (keyword? :'// -) (keyword? :-:) ;;=> RuntimeException Invalid token: :-: clojure.lang.Util.runtimeException (Util.java:221) ;;=> RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) ;; https://clojure.org/reference/reader states: ;; "Symbols beginning or ending with ':' are reserved by Clojure." (keyword? :-:-) ;;=> true ;; https://clojure.org/reference/reader states: ;; "A symbol can contain one or more non-repeating ':'s" and: ;; "Keywords are like symbols, [...]" (keyword? :....) ;;=> true (keyword? :,,,,) ;;=> RuntimeException Invalid token: : clojure.lang.Util.runtimeException (Util.java:221) ;;=> RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) ;; Note: the comma is taken as space, so the code above is equivalent to (keyword? : ) (keyword? :a:b:c) ;;=> true (keyword? :a.b.c) ;;=> true (keyword? :73) ;;=> true
Returns a Keyword with the given namespace and name. Do not use : in the keyword strings, it will...
keyword?