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

2 Examples top

  • ;;getting meta-data for a defined symbol (as opposed to what it's pointing to.
    user=> meta
    #<core$meta clojure.core$meta@2e257f1b>
    user=> (var meta)
    user=> (meta (var meta))
    {:ns #<Namespace clojure.core>, :name meta, :file "clojure/core.clj", :line 178, :arglists ([obj]), :doc "Returns the metadata of obj, returns nil if there is no metadata.", :added "1.0"}
  • => *clojure-version*
    {:major 1, :minor 5, :incremental 0, :qualifier "RC17"}
    => var
    ;CompilerException java.lang.RuntimeException: Unable to resolve symbol: var in this context, compiling:(NO_SOURCE_PATH:1:42) 
    => (var)
    ;CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:1:1) 
    => (var 1)
    ;CompilerException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:1:1) 
    => (var defn)
    => (var defn 1 2 3 4)
Log in to add / edit an example.

See Also top

Log in to add a see also.

Comments top

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