Fork me on GitHub
#cursive
<
2019-02-27
>
cfleming01:02:54

@kanwei Yes, there’s an issue about that, thanks.

cfleming01:02:36

@genekim I’’d be interested to know what you find works - scratch files can be weird, I have an outstanding issue to test them properly. I like manutter51's idea, I think.

genekim01:02:47

@cfleming Scratchfiles work, with surprisingly little effort — was able to make a new Scratchfile, go into it, and do some forms — (+ 1 1), 1. No problems there. What was a little surprising was that it kept me in the same namespace as before, which was great. I thought I would have to make a new (ns xxx) or something... (That's actually a pleasant surprise. So easy!)

genekim01:02:09

@cfleming @manutter51 — to be specific, what appeals to me about the "personal" directory is that I can work on different machines. Already, there have been times when I went home w/o checking everything into the repo, and couldn't work on something. The idea that there would be another bunch of work I could do that I might forget to check in somewhere seems... dangerous. 🙂

potetm02:02:59

@genekim re: your initial comment: I often work inside of a comment block when I have scratch work.

potetm02:02:39

I did the scratch file thing for a while, but I didn’t find it worth the effort.

potetm02:02:41

I do use a dev dir where people can be much more loosie goosie.

potetm02:02:34

But comment forms are super for exploring things in-place.

genekim03:02:24

Oh! I read about using comment, but for whatever reason, I was using the #_ form instead. Holy cow, comment is so much nicer! I think I was using #_ because there is a keyboard accelerator for it: Command-/. 🙂 Is there a Cursive keyboard command to comment out multiple S expressions? (Like wrapping them up in a big ol' comment?) Thx all!

potetm02:02:06

(Perhaps not directly answering your question, but thought you mind find my “there and back again” story useful 🙂)

genekim03:02:24

Oh! I read about using comment, but for whatever reason, I was using the #_ form instead. Holy cow, comment is so much nicer! I think I was using #_ because there is a keyboard accelerator for it: Command-/. 🙂 Is there a Cursive keyboard command to comment out multiple S expressions? (Like wrapping them up in a big ol' comment?) Thx all!

potetm04:02:34

I didn’t even know cmd-/ did form comments 😛

potetm04:02:55

I use slurp/barf — I don’t think there’s a special command

potetm04:02:01

bear in mind: #_ and comment are _slightly_ different. comment returns nil, #_ ignores at the reader.

potetm04:02:16

this has gotten me before

genekim04:02:45

@potetm — what a game changer! Working in a comment form is magical! I'm loving it. Thanks!!!

potetm04:02:06

my pleasure 🙂

cfleming08:02:25

@genekim No, the IntelliJ “Comment with Block Comment” command should do that, but doesn’t (yet)

cfleming08:02:13

Also, one of the nice things about using comment is that you can use “Send top form to REPL” from within a comment block and it will send the top-level form within the comment block, not the comment itself.

cfleming08:02:04

So if you’re here:

(comment
  (+ 1 2|))
(where | is the caret), then “Send top form” will eval (+ 1 2).

potetm13:02:50

^^ that’s how I use it

potetm13:02:54

it worked so naturally, I didn’t even notice it’s sending not-quite-the-top form

helios15:02:30

is there a way to automatically reorder alphabetically ns in :require ?

Lennart Buit19:02:27

I use a IntelliJ plugin for that

Lennart Buit19:02:05

But it works better when you require like this:

(ns my-ns
  (:require
    [abc]
    [def]))

helios21:02:33

Yeah i do it like that, thanks

salam23:02:51

https://plugins.jetbrains.com/plugin/2162-string-manipulation seems to have a similar but more sophisticated sorting feature along with other additional handy-dandy string manipulation features.

5
genekim16:02:00

@cfleming @potetm Yes, I noticed that right away. For a couple of marvenlous hours last night, I worked within a source file comment block, sending forms to the REPL, and then copying code outside the comment block when done. Describing what was so different and awesome defies easy explanation, but I felt so much more productive vs. not working within a comment block. I'll try to write something up in the next week or two — it's not an understatement to say that it's one of my biggest aha moments of Clojure. Thank you!!!

genekim16:02:54

PS: I think it has to do with the way it encourages documentation and the evolution of the code, as well as how it keeps codes around that actually calls the function — as opposed to burying the function inside of another function, inside a let block. Makes it much easier to change and test it later.

potetm20:02:53

I have some videos of how I tend to work here: https://potetm.com/videos.html

genekim19:02:08

Thank you @potetm — I'll check it out over the day or two!!!!

potetm20:02:34

I made those because I totes agree w/ @genekim, and I wanted to show other people what it’s like.

potetm20:02:01

And I don’t really have words for it, so I hope you find some 🙂

p-himik21:02:09

I've created a REPL configuration and I'm trying to set -e "(require 'dev) (in-ns 'dev)" as its Parameters. However, when I start it, it turns into -e \"(require 'dev) (in-ns 'dev)\" and leads to Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: EOF while reading string Is there any way to prevent that seemingly unnecessary escaping of the double quotes?

p-himik21:02:33

Hmm, if I provide -e '(require (quote dev)) (in-ns (quote dev))' it's not changed, but leads to EOF while reading, starting at line 1 for some reason. At the same time, works just fine in the console.

p-himik21:02:09

It doesn't like spaces and single quotes don't fix that.

manutter5121:02:04

Try commas instead of spaces?

p-himik21:02:57

Great idea! I completely forgot about the commas. In the meantime, I managed to do the same by using :main-opts in deps.edn. In any case, it doesn't work as I wanted it to - the ns within the nREPL session is not changed.

p-himik21:02:22

OK, I just spoiled my user ns as was suggested earlier. That works.

carocad21:02:29

@cfleming since a month or so everytime that I am in the debugger and try to realize a lazy sequence (with a watch expression), the debugger gets stuck in “Collecting data …“. If I afterwards remove the watch, and click the play button, the repl then gets stuck as well. Is there some kind of hidden setting that I screwed or is it a bug ?

cfleming21:02:02

@carocad I don’t think there’s a setting for that, it sounds like a bug. Do you have some repro steps, and I can try to reproduce it?

carocad21:02:05

mmmm besides what I mentioned above … nothing really. It happens all the time when trying to get info on lazy sequences

carocad21:02:19

if there is a way to give you a log I am happy to help

cfleming21:02:32

But you have a watch on the sequence itself too?

carocad21:02:24

yes. For example, lets say that I have a function that returns a lazy seq like (map str something-else). Then in the debugger I add a watch + containing (vec my-lazy-result). I can see the watch in the debugger but it is stuck collecting data

carocad21:02:25

@cfleming see attached image

cfleming22:02:15

Ok, thanks - I’ll try to reproduce that.

5