Permalink
Browse files

Render the value in-thread before sending off in order to always prin…

…t mutable values correctly
  • Loading branch information...
bendlas authored and dgrnbrg committed Nov 1, 2012
1 parent 735e1d4 commit 80781e9bca80767f24ecda641d02b182261b31e6
Showing with 11 additions and 12 deletions.
  1. +11 −12 src/spyscope/core.clj
View
@@ -69,19 +69,18 @@
"Reader function to store detailed information about a form's value at runtime
into a trace that can be queried asynchronously."
[form]
- `(let [f# ~form]
+ `(let [f# ~form
+ value# (pretty-render-value f#
+ ~(assoc (meta form)
+ ::form (list 'quote form)))]
(send-off trace-storage
- (fn [{g# :generation t# :trace :as storage#}]
- (let [value# (pretty-render-value
- f#
- ~(assoc (meta form)
- ::form (list 'quote form)))]
- (when ~(::print? (meta form))
- (println (:message value#)))
- (assoc storage#
- :trace
- (conj t# (assoc value#
- :generation g#))))))
+ (fn [{g# :generation t# :trace :as storage#}]
+ (when ~(::print? (meta form))
+ (println (:message value#)))
+ (assoc storage#
+ :trace
+ (conj t# (assoc value#
+ :generation g#)))))
f#))
(defn print-log-detailed

0 comments on commit 80781e9

Please sign in to comment.