Changes for clojure.core/set-validator!

Aaron Brooks on Tue, 22 May 2012
user=> (def atm (atom [2])
#'user/atm

user=> (set-validator! atm #(every? even? %))
nil

user=> (swap! atm into [5])
#<CompilerException java.lang.IllegalStateException: Invalid reference state (NO_SOURCE_FILE:0)>

user=> (set-validator! atm nil)
nil

user=> (swap! atm into [5]))
[2 5]
nickbauman on Wed, 18 Jan 2012
(let [atm (atom [2])]
  (set-validator atm #(every? even? %)) ; side effect
  (swap! g into [5]))
  ; #<CompilerException java.lang.IllegalStateException: Invalid reference state (NO_SOURCE_FILE:0)>
  (set-validator atm nil)
  (swap! g into [5]))
  ; >>> [2 5]
nickbauman on Wed, 18 Jan 2012
(let [atm (atom [2])]
  (set-validator atm #(every? even? %)) ; side effect
  (swap! g into [5]))
  ; #<CompilerException java.lang.IllegalStateException: Invalid reference state (NO_SOURCE_FILE:0)>