Perhaps this is a dumb question, but I can’t seem to evaluate anything directly from Chlorine’s socket REPL. I can evaluate forms from the editor just fine, but after typing something like (inc 1)
, I can’t seem to figure out any way to evaluate it. If I try the Chlorine evaluation commands in the REPL, I get errors about getCursorBufferPosition
. Am I way off here?
@kingmob Chlorine's REPL panel is not intended for input, just for display.
Ahh, so I’d have to use the shell REPL or REBL then?
My workflow is to never type things into a REPL anyway, while I'm working. I put a (comment ...)
form in my source (or test) file and write exploratory code there, evaluating it as I write it, into the REPL.
That’s unfortunately not my workflow 🙂
Thanks for answering, though. I thought I was taking crazy pills for a hot minute.
Stu Halloway says folks should not type into the REPL directly too...
Hmm. Still, there’s things I sometimes want to test without jumping to a (comment)
section, nor that I’m willing to add to the file (semi-)permanently. I’ve seen (comment)
sections become misleadingly out-of-date.
Perhaps more REBL will reduce the need to type at the REPL, but it still seems like an unnecessary restriction to me, especially in exploratory mode.
Oh well. Thx again for responding!
If you end up using the same setup as me -- with REBL and Chlorine -- then you do have the REBL window to type exploratory stuff into, and it maintains a history etc.
Yeah, I’ve needed to set aside some time to incorporate REBL more thoroughly. Maybe <4% of my REPL usage isn’t from the editor, but when I think about it, a majority of that is examining data, which REBL should be great at.
You can also create separate files for expressions to evaluate, without "regular" project source code in the same file.
Sure, some of it can easily get out of date, but maybe it is psychologically easier to accept that fact if it isn't in a source file?
I recently created a file named "doc/scratch1.clj" in one of my projects for that purpose
Doesn't Stu do something like that? With a new scratch file for every month? And my colleague does something similar.
I believe I did copy the idea from something Stu Halloway mentioned in one of his recent talks.