https://clojure.org/reference/vars says
Clojure is a practical language that recognizes the occasional need to > maintain a persistent reference to a changing value and provides 4 distinct > mechanisms for doing so in a controlled manner - Vars, Refs, Agents and > Atoms. Vars provide a mechanism to refer to a mutable storage location that > can be dynamically rebound (to a new storage location) on a per-thread > basis. > https://clojure.org/reference/special_forms says Using def to modify the root value of a var at other than the top level is > usually an indication that you are using the var as a mutable global, and > is considered bad style. Consider either using binding to provide a > thread-local value for the var, or putting a ref or agent in the var and > using transactions or actions for mutation. Clojure encourages avoiding the use of vars as global thread-local storage, by restricting their use to dynamic binding only. What is so bad about global thread-locals? It can't be the fact that they are global, as refs are typically made global. They also have a good thread-safe behavior. Thanks, Ernesto -- 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/d/optout.