Fork me on GitHub
#cursive
<
2019-02-26
>
genekim20:02:25

Newbie question: when you’re doing “REPL-driven development”, typing forms into a .clj file, sending them to the REPL, where do you store all these scratch / demo .clj files? On the one hand, I don’t want them to be under ./src, because all the def forms I often use are evaluated when I do lein run. I’d like to keep all the demo / scratch code separated from the “real code.” (Code that I knows works.) On the other hand, I think Cursive needs them to be under ./src in order to be sent to REPL. (Is this true?) Where do y’all store these types of scratch files? (I heard that people use the “user” namespace? But can you store these under ./src, too?) Thank you for indulging my basic question!

manutter5120:02:02

You can create IntelliJ scratch files (Ctrl-Shift-N on a Mac) and cursive will send them to the repl correctly

👍 5
Alex Miller (Clojure team)20:02:08

some people use a "siderail" directory for stuff like that

Alex Miller (Clojure team)20:02:59

I don't honestly know the origin of that as a word for this use

manutter5120:02:08

At the bottom of your Projects sidebar, there’s a section called Scratches and Consoles, containing a folder called Scratches, where all the scratch files live.

manutter5120:02:48

(which I didn’t know for a long time, and I had a ton of files there when I figured it out--apparently they’re IntelliJ-specific, not project specific, so I had them from every project I ever worked on.)

genekim20:02:32

Whoa @alexmiller @manutter51. 🤯🤯🤯🤯 Wow. THANK YOU!!! Can’t wait to try it out!!!

manutter5120:02:30

Our group also has a convention of adding a personal directory to a project, and each dev creates their own personal scratch file in there. The personal dir shows up in the :source-paths under the :project/dev profile, but not under the :prod profile, so we have access to them in dev but they don’t get included in the final build.

manutter5120:02:17

The personal files all get checked in to source control, which I think is a net benefit, and sometimes leads to inadvertently sharing tribal knowledge.

p-himik21:02:23

That's actually a great idea, thanks!

genekim21:02:06

@manutter51 "personal" directory. Fabulous idea. I just investigated the Scratches feature — all these files are stored in the IntelliJ config directory. I'll have to think about how I use this... I love the idea of putting these files into source control, along with the rest of the project. (I'll let you know what direction I end up going in. But I'll definitely be incorporating one of these approaches!) Thanks, all!

kanwei21:02:48

you've probably seen this already but the 2019.1 EAP with runtime jdk11 triggers this error on startup:

kanwei21:02:58

java.lang.ExceptionInInitializerError Caused by: java.lang.ClassNotFoundException: javax.xml.ws.Provider PluginClassLoader[com.cursiveclojure.cursive, 1.8.1-eap3-2019.1] com.intellij.ide.plugins.cl.PluginClassLoader@15e50820

kanwei21:02:35

from deprecated EE modules

genekim21:02:06

@manutter51 "personal" directory. Fabulous idea. I just investigated the Scratches feature — all these files are stored in the IntelliJ config directory. I'll have to think about how I use this... I love the idea of putting these files into source control, along with the rest of the project. (I'll let you know what direction I end up going in. But I'll definitely be incorporating one of these approaches!) Thanks, all!