File tree Expand file tree Collapse file tree 1 file changed +26
-25
lines changed Expand file tree Collapse file tree 1 file changed +26
-25
lines changed Original file line number Diff line number Diff line change 155
155
" prints an explanation to *out*."
156
156
[ed]
157
157
(if ed
158
- (do
159
- ; ;(prn {:ed ed})
160
- (doseq [[path {:keys [pred val reason via in] :as prob}] (::problems ed)]
161
- (when-not (empty? in)
162
- (print " In:" in " " ))
163
- (print " val: " )
164
- (pr val)
165
- (print " fails" )
166
- (when-not (empty? via)
167
- (print " spec:" (last via)))
168
- (when-not (empty? path)
169
- (print " at:" path))
170
- (print " predicate: " )
171
- (pr pred)
172
- (when reason (print " , " reason))
173
- (doseq [[k v] prob]
174
- (when-not (#{:pred :val :reason :via :in } k)
175
- (print " \n\t " k " " )
176
- (pr v)))
177
- (newline ))
178
- (doseq [[k v] ed]
179
- (when-not (#{::problems } k)
180
- (print k " " )
181
- (pr v)
182
- (newline ))))
158
+ (print
159
+ (with-out-str
160
+ ; ;(prn {:ed ed})
161
+ (doseq [[path {:keys [pred val reason via in] :as prob}] (::problems ed)]
162
+ (when-not (empty? in)
163
+ (print " In:" in " " ))
164
+ (print " val: " )
165
+ (pr val)
166
+ (print " fails" )
167
+ (when-not (empty? via)
168
+ (print " spec:" (last via)))
169
+ (when-not (empty? path)
170
+ (print " at:" path))
171
+ (print " predicate: " )
172
+ (pr pred)
173
+ (when reason (print " , " reason))
174
+ (doseq [[k v] prob]
175
+ (when-not (#{:pred :val :reason :via :in } k)
176
+ (print " \n\t " k " " )
177
+ (pr v)))
178
+ (newline ))
179
+ (doseq [[k v] ed]
180
+ (when-not (#{::problems } k)
181
+ (print k " " )
182
+ (pr v)
183
+ (newline )))))
183
184
(println " Success!" )))
184
185
185
186
(defn explain
You can’t perform that action at this time.
0 commit comments