cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
yuhan 2021-04-17T03:16:54.310700Z

@macrobartfast what about using comment forms?

macrobartfast 2021-04-17T03:22:53.310900Z

Well, I have in the past… but that just clutters my code overall and makes it less readable… and I have to type it all out. When cider-read-and-eval-defun-at-point worked, it was literally just a matter of the binding that triggered the function, tap in a couple arguments when it appeared in the minibuffer, and enter and voila.

yuhan 2021-04-17T03:47:13.311500Z

Right, that's understandable - I've never used that command before but it seems useful. What I sometimes do is take advantage of the fact that (#'foo x) calls the function in the var - so I'll do a quick wrap-round and forward-sexp

((defn foobar [x]
   (* 2 x)) 10)
try out a couple of arguments without having to go back and forth with the minibuffer + history, then raise the defun when I'm done to get rid of the args.

yuhan 2021-04-17T03:55:35.311700Z

(this is particularly useful when you're debugging some function definition on a fixed set of arguments - cider-eval-defun from anywhere in the form re-defs the function and calls it in one go)

macrobartfast 2021-04-17T05:04:33.311900Z

That is really interesting… I’ll give those approaches a try.

macrobartfast 2021-04-17T05:11:44.312100Z

do you use something to toss the wrap-around on and remove it quickly?

macrobartfast 2021-04-17T05:12:06.312300Z

I know there are things in Emacs that do that, but I do it semi-manually with paredit.

yuhan 2021-04-17T05:30:56.312500Z

I use lispy(ville) but paredit or any other structural-editing package should work fine once you get it into muscle memory 🙂

yuhan 2021-04-17T05:36:22.312700Z

for me it's ESC (evil normal state), { (start of defun) M-9 (wrap in parens) M-a (goto end of form and enter evil insert state) then at the end, navigate to the right spot and M-r to raise

bozhidar 2021-04-17T09:17:39.313300Z

It seems to me your problem is quite simple - you haven’t evaluated the defun in question when before doing read-and-eval.

bozhidar 2021-04-17T09:18:24.313800Z

I normally do tests like the one you described in a REPL or a scratch buffer, but that’s just me.