On Sun, Jun 19, 2011 at 11:58 AM, Andreas Liljeqvist <bon...@gmail.com>wrote:

> I am trying to set! *printlength* to something not insanity inducing.
> Problem is that user.clj doesn't support set!
>

Vars normally only have a global root binding.
When you use (binding [varname newvalue]) the var gets given a thread-local
binding, and you can change the value of that binding with set!

The repl gives thread bindings to a number of variables that you might want
to change, but user.clj is called before the repl, and at that point the
vars just have their root bindings which set! can't changed.

You could change the root binding from user.clj by using:

  (alter-var-root #'*print-length* (constantly 5))

-- 
Dave

-- 
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