0

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"
2

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"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.