You're viewing version 1.2.0 of special-symbol?. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16



  • (special-symbol? s)
Returns true if s names a special form

1 Example top

  • user=> (clojure-version)
    ;; the set of special symbols for this clojure-version are the following:
    user=> (keys (. clojure.lang.Compiler specials))
    (deftype* new quote & var set! monitor-enter recur . case* clojure.core/import* reify* do fn* throw monitor-exit letfn* finally let* loop* try catch if def)
    ;; for example, "def" is not a function, not a macro, not even a var, but a special form:
    user=> (fn? 'def)
    user=> (:macro (meta (find-var 'clojure.core/def)))
    user=> (find-var 'clojure.core/def)
    user=> (special-symbol? 'def)
    ;; while "defn" is not a special form but a macro:
    user=> (special-symbol? 'defn)
    user=> (:macro (meta (find-var 'clojure.core/defn)))
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:3929 top

(defn special-symbol?
  "Returns true if s names a special form"
  {:added "1.0"}
    (contains? (. clojure.lang.Compiler specials) s))
Vars in clojure.core/special-symbol?: contains? defn
Used in 1 other vars add-core-ns

Comments top

No comments for special-symbol?. Log in to add a comment.