You can do (set! *warn-on-reflection* true) because *warn-on-reflection*
is already thread-locally bound...
Is the REPL running inside a binding?
essentially yes...
Is it possible to
add other forms of this binding? Or not?
as Atkaaz pointed out yesterday these vars are in Java code so I'm
presuming you can't...
Jim
ps: I remember seeing a SO post not too long ago about exactly what
you're confused by...a quick look turned this up which is answered by
Chouser:
http://stackoverflow.com/questions/10986293/how-to-set-a-dynamic-var-in-another-namespace
however, this is not the one I remember!
On 16/05/13 11:33, Phillip Lord wrote:
"Jim - FooBar();" <jimpil1...@gmail.com> writes:
(set!*my-test* true)
(alter-var-root #'*my-test* (constantly true))
here explains what you're asking:
http://clojure.org/Vars
scroll down to until you see
No, this only explains why
(def ^{:dynamic true} *my-test* false)
(set! *my-test* true)
causes an error. What it doesn't explain is why
(set! *warn-on-reflection* true)
works just fine. Is the REPL running inside a binding? Is it possible to
add other forms of this binding? Or not? And if it is okay to use set!
on *warn-on-reflection*, why is it not okay to allow me, as the library
developer, to define similar properties for my library which work in a
similar way.
Phil
--
--
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
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.