Skip to content

Commit 3d7e455

Browse files
committedApr 21, 2024
[inspector] Remove eval-and-inspect
Since I introduced it back in 2019 (see #38), it never got a cider-nrepl op counterpart and nobody seemed to miss it (and apparently neither did I, lol).
1 parent a468862 commit 3d7e455

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed
 

‎src/orchard/inspect.clj

-13
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,6 @@
254254
{:pre [(integer? max-nested-depth)]}
255255
(inspect-render (assoc inspector :max-nested-depth max-nested-depth)))
256256

257-
(defn eval-and-inspect
258-
"Evaluate the given expression where `v` is bound to the currently inspected
259-
value. Open the evaluation result in the inspector."
260-
[inspector expr]
261-
(let [{:keys [current-page value]} inspector
262-
eval-fn `(fn [~'v] ~(read-string expr))
263-
result ((eval eval-fn) value)]
264-
(-> (update inspector :stack conj value)
265-
(update :pages-stack conj current-page)
266-
(assoc :current-page 0)
267-
(update :path conj '<unknown>)
268-
(inspect-render result))))
269-
270257
(defn def-current-value
271258
"Define the currently inspected value as a var with the given name in the
272259
provided namespace."

‎test/orchard/inspect_test.clj

-19
Original file line numberDiff line numberDiff line change
@@ -365,25 +365,6 @@
365365
(is (= 2 (:current-page ins)))
366366
(is (= 4 (:current-page (inspect/up ins))))))))
367367

368-
(deftest eval-and-inspect-test
369-
(testing "evaluate expr in the context of currently inspected value"
370-
(is (match? (list "Class"
371-
": " (list :value "java.lang.String" number?)
372-
'(:newline)
373-
"Value: " "\"1001\""
374-
'(:newline)
375-
'(:newline)
376-
"--- Print:"
377-
'(:newline)
378-
" " "1001"
379-
'(:newline))
380-
(-> eval-result
381-
inspect
382-
(inspect/down 2)
383-
(inspect/down 2)
384-
(inspect/eval-and-inspect "(str (+ v 1000))")
385-
render)))))
386-
387368
(deftest def-value-test
388369
(testing "define var with the currently inspected value"
389370
(-> eval-result

0 commit comments

Comments
 (0)