4

If I want to demonstrate something, is it possible that I can run a command on cider and it prints after each line the result of evaluating that line ?

(def xx {:a "a" :b "b"})
(:a xx)
(:c xx [])

And, after running (something similar to):

(def xx {:a "a" :b "b"}) ; => #'ns-name.playground/xx
(:a xx) ; => "a"
(:c xx "nothing") ; => "nothing"
Rodrigo Flores
  • 275
  • 1
  • 7

1 Answers1

7

Yes. C-u C-x C-e eval-last-sexp-and-insert , evaluates the last sexp and inserts it at point. or: in the cider-eval menu : eval-last-sexp-and-pretty-print-comment insert the output as a comment in the following line like so:

(def xx {:a "a" :b "b"}) 
;; => #'ns-name.playground/xx
(:a xx)  
;; => "a"
(:c xx "nothing") 
;; => "nothing"
manandearth
  • 2,068
  • 1
  • 11
  • 23