@macrobartfast what about using comment
forms?
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.
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.(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)
That is really interesting… I’ll give those approaches a try.
do you use something to toss the wrap-around on and remove it quickly?
I know there are things in Emacs that do that, but I do it semi-manually with paredit.
I use lispy(ville) but paredit or any other structural-editing package should work fine once you get it into muscle memory 🙂
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
It seems to me your problem is quite simple - you haven’t evaluated the defun in question when before doing read-and-eval
.
I normally do tests like the one you described in a REPL or a scratch buffer, but that’s just me.