Fork me on GitHub
Steve Peterson12:11:29

Found something that I cannot understand. New Leiningen project. I have an almost empty (`(ns user)`) user.clj file in dev folder. In project.clj: :source-paths ["dev"] :repl-options {:init-ns user}. If I start REPL in Cursive and use "Send form before caret to REPL” to send (set! *warn-on-reflection* true) from user.clj, it does return true in the REPL but warnings are not shown. If I instead paste (set! *warn-on-reflection* true) directly in the REPL, warnings are shown. Why the difference?

Alex Miller (Clojure team)13:11:26

The set! will only work when you are in the scope of a dynamic binding where it will retain its local binding