This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-27
Channels
- # beginners (113)
- # calva (39)
- # cider (18)
- # cljs-dev (19)
- # cljsrn (1)
- # clojure (80)
- # clojure-dusseldorf (1)
- # clojure-finland (1)
- # clojure-gamedev (1)
- # clojure-germany (2)
- # clojure-italy (38)
- # clojure-nl (16)
- # clojure-spec (90)
- # clojure-uk (81)
- # clojurescript (28)
- # clojutre (9)
- # cursive (47)
- # data-science (4)
- # datomic (21)
- # emacs (1)
- # events (2)
- # fulcro (11)
- # graphql (2)
- # hoplon (8)
- # hyperfiddle (23)
- # jobs (2)
- # kaocha (4)
- # lein-figwheel (1)
- # luminus (1)
- # mount (1)
- # off-topic (41)
- # pathom (5)
- # pedestal (27)
- # reitit (6)
- # remote-jobs (7)
- # ring-swagger (6)
- # shadow-cljs (42)
- # spacemacs (1)
- # sql (9)
- # tools-deps (6)
- # uncomplicate (2)
- # vim (5)
@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.
@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!)
@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. 🙂
@genekim re: your initial comment: I often work inside of a comment
block when I have scratch work.
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!
(Perhaps not directly answering your question, but thought you mind find my “there and back again” story useful 🙂)
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!
bear in mind: #_
and comment
are _slightly_ different. comment
returns nil
, #_
ignores at the reader.
@potetm — what a game changer! Working in a comment
form is magical! I'm loving it. Thanks!!!
@genekim No, the IntelliJ “Comment with Block Comment” command should do that, but doesn’t (yet)
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.
So if you’re here:
(comment
(+ 1 2|))
(where |
is the caret), then “Send top form” will eval (+ 1 2)
.I use a IntelliJ plugin for that
But it works better when you require like this:
(ns my-ns
(:require
[abc]
[def]))
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.
@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!!!
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.
I have some videos of how I tend to work here: https://potetm.com/videos.html
I made those because I totes agree w/ @genekim, and I wanted to show other people what it’s like.
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?
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.
Try commas instead of spaces?
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.
@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 ?
@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?
mmmm besides what I mentioned above … nothing really. It happens all the time when trying to get info on lazy sequences