You're viewing version 1.2.0 of var?. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16
  • (var? v)
Returns true if v is of type clojure.lang.Var

2 Examples top

  • (def my-symbol)
    (var? #'my-symbol)
    => true
    
    (var? (var my-symbol))
    => true
    
    (var? (def my-symbol2))
    => true
  • => *clojure-version*
    {:major 1, :minor 5, :incremental 0, :qualifier "RC17"}
    => var?
    #<core$var_QMARK_ clojure.core$var_QMARK_@669251cc>
    => (var?)
    ;ArityException Wrong number of args (0) passed to: core$var-QMARK-  clojure.lang.AFn.throwArity (AFn.java:437)
    => (var? 1)
    false
    => (var? defn)
    ;CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/defn, compiling:(NO_SOURCE_PATH:1:1) 
    => (var? #'defn)
    true
    => (var? #'defn 1 2 3 4)
    ;ArityException Wrong number of args (5) passed to: core$var-QMARK-  clojure.lang.AFn.throwArity (AFn.java:437)
    => (var? (var defn))
    true
    => (var? apply)
    false
    => (var? #'apply)
    true
    
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:3935 top

(defn var?
  "Returns true if v is of type clojure.lang.Var"
  {:added "1.0"}
  [v] (instance? clojure.lang.Var v))
Vars in clojure.core/var?: defn instance?

Comments top

No comments for var?. Log in to add a comment.