Fork me on GitHub
#cursive
<
2021-03-12
>
robert-stuttaford05:03:16

hey @cfleming probably a question you get all the time, but.... how's inline eval coming along? this is probably the thing that i'm feeling the most pain on, after a week or so, now that i've moved past the nails-on-chalkboard experience of relearning keyboard shortcuts 😁

9
imre09:03:28

What editor are you coming from and why did you switch? Also, have you thought about rebinding?

raspasov10:03:56

I know that’s not the same, but there’s “Send Top Form to REPL”

robert-stuttaford10:03:18

Emacs, because i'm tired of waiting for it to render large blocks of text, and restarting it after it crashes. probably both fixable, but i don't have the bandwidth to learn elisp nor learn how to navigate elisp-oss-world heh

robert-stuttaford10:03:43

I use the send-to-repl stuff @U050KSS8M - but it's not the same. i want that lighttable experience!

robert-stuttaford10:03:15

rebinding: i tried the emacs bindings briefly but when i couldn't cut or paste i noped out of there

robert-stuttaford10:03:28

i've learned enough to get by now, incl the structural editing stuff

raspasov10:03:44

@U0509NKGK understood 🙂 I’ve seen the inline eval in videos and people doing it… for me the REPL is perhaps even better, because it’s more “permanent”; allows you to search for the output, etc. I almost always keep the REPL open. But I realize people have different preferences. Also, I use almost 100% custom key binding for everything; suits the ergonomics of my hands the best, I feel like. Re: IntelliJ pro tip I just found literally 30 min ago: “Always Select Opened File”

raspasov10:03:59

“Always Select Opened File” is literally amazing 🙂

raspasov10:03:53

It works for any file, both in your projects and in libraries.

robert-stuttaford11:03:04

I was looking for that yesterday. You're a saint!

robert-stuttaford11:03:08

on permanence of repl: yeah, in emacs, you can eval-then-paste-output into your buffer, and you can print to the repl. i used all three daily

raspasov16:03:23

@U0509NKGK cheers 🙂 I randomly found that it existed yesterday after ~6 years of IntelliJ

raspasov17:03:18

Another super-awesome thing (which I don’t see many people use in videos, etc) is Tools > REPL > Sync Files in REPL

😀 6
raspasov17:03:56

Just make a keybinding for it and trigger it any time you make a change… No more eval-ing functions one by one!

raspasov17:03:33

I keep seeing people eval-ing one-by-one and I feel like it’s a waste of time.

aratare17:03:10

Is that any different from reloading the files?

raspasov18:03:32

Eval-ing achieves the same effect, but Tools > REPL > Sync Files in REPL … figures out for you which files have changed and just reloads them. You don’t need to keep the “state” of your REPL in your head. As far as I can tell, it just keeps track of changed files and calls (load-file …) https://clojuredocs.org/clojure.core/load-file … on each changed file.

👍 3
cfleming06:03:47

@U0509NKGK Sorry for the delay, I’ve been off-grid camping over the weekend. So my usual answer to that question is “sometime soon” which unfortunately often turns out to be a lie. However in this case I am actually working on a proof of concept so I can confidently say that it might actually be “soon” :-)

❤️ 3
cfleming06:03:40

@U050KSS8M @U013F1Q1R7G Right, sync basically works out which files you’ve changed and loads them all in dependency order. Load file also does that, except only starting with the file that you’re loading (i.e. that file and all its dependencies will be loaded if modified). sync will do that for all files, even if the current file doesn’t depend on them.

👍 3
aratare06:03:01

I see. I have a habit of loading files whenever I make any changes so I haven’t had a chance to use sync yet

robert-stuttaford06:03:40

@cfleming you tease! 😆 seriously, that sounds fantastic, mate. sending you lots of Lisp energy from the Netherlands. good luck!

robert-stuttaford06:03:25

I habitually use load-file when making changes too, and eval-leftmost-form when doing stuff from inside (comment) blocks (like testing db code)

cfleming09:03:19

“Send top form to REPL” will work in comment blocks too, it sends the topmost form inside the comment, not the comment itself.

robert-stuttaford10:03:14

do you mean the one that is bound to cmd-shift-p, @cfleming?

robert-stuttaford10:03:06

i don't see a 'topmost' item here

robert-stuttaford10:03:16

when i use cmd-shift-p, it evals the comment form

imre12:03:26

@U0509NKGK that behaviour depends on where your caret's at. If you are somewhere inside (def db ... ) then cmdshiftP would eval the def. From your screenshot I'm assuming you are just after the def form.

cfleming20:03:38

Right, the name of the command in the menu is customised to show what it will actually do, but one is “Send top form” and the other is “Send form before caret”.

borkdude14:03:38

Can someone using Cursive perhaps review this PR? https://github.com/clj-kondo/clj-kondo/pull/1214