> The metadata tells you why:
>
>     user=> (meta #'*dynamo*)
>     {:ns #<Namespace user>, :name *dynamo*, :dynamic true, :line 1, :file ...}

The var tells you why:
user=> (.isDynamic (var *dynamo*))
true

>
> Now let's make another variable with `intern`, copying the metadata from 
> `*dynamo*`:
>     user=> (intern *ns* (with-meta '*copy* (meta #'*dynamo*)) *dynamo*)
> Same metadata (except for the name):
>     user=> (meta #'*copy*)
>     {:ns #<Namespace user>, :name *copy*, :dynamic true, :line 1, :file ...}
> But you can't rebind:
>     user=> (binding [*copy* "new value"] *copy*)
>     IllegalStateException Can't dynamically bind non-dynamic var: user/*copy* 
>  clojure.lang.Var.pushThreadBindings (Var.java:339)

user=> (.isDynamic (var *copy*))
false
user=> (.setDynamic (var *copy*))
#'user/*copy*
user=> (binding [*copy* "new value"] *copy*)
"new value"

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to