Fork me on GitHub
#spacemacs
<
2020-12-26
>
prnc13:12:29

since “tap> is the new print” 😜 are there any helper fns in cider or clojure mode for tapping? (e.g. like there are for pretty printing)?

practicalli-johnny13:12:32

I am not aware of any cider commands for tap>. I tend to use cider-inspect rather than tap when using Emacs

practicalli-johnny15:12:21

I assume it wouldn't be too difficult to write some. I believe you can write a bit of elisp to call Clojure code and then bind that in an interactive function to a key

practicalli-johnny15:12:37

I have just been using a rich comment block to call tap functions for now. https://github.com/practicalli/scicloj-notespace-simple-demo/blob/live/src/practicalli/notespace_demo.clj#L145 I also use a user.clj to run the portal data browser and add it as a tap source. There is an example in the dev/user.clj file in the repository above

prnc16:12:13

Thanks @U05254DQM. I use the cider inspector as well, but sometimes things like portal etc. can come in handy. I’ve ended up doing this:

prnc16:12:26

(defun prnc/clojure-eval-tap ()
    (interactive)
    (cider-interactive-eval
     (format "(tap> %s)"
             (apply #'buffer-substring-no-properties
                    (cider-last-sexp 'bounds)))))
  (spacemacs/set-leader-keys-for-major-mode 'clojure-mode (kbd "et") 'prnc/clojure-eval-tap)

👍 3
prnc16:12:56

as a quick hack to see if I like this workflow