calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
lspector 2021-06-03T01:45:38.149200Z

I agree that it's hard to know, but FWIW I think it's a good idea to err on the side of meeting people where they are, which would mean to default to behaving in ways they would expect based on their experience typing/editing in other environments.

Hukka 2021-06-03T05:26:46.150Z

Hm, my *print-length* is nil, but long maps still get truncated. Is there something calva special that I need to adjust?

pez 2021-06-03T07:06:14.167900Z

No worries, I am happy you did!

Hukka 2021-06-03T05:27:30.150100Z

Ah, https://calva.io/pprint/

Hukka 2021-06-03T05:29:15.150400Z

Excellent, the settings were changed on the fly!

pez 2021-06-03T06:07:36.150600Z

Means you solved it? 😃

pez 2021-06-03T06:37:51.167500Z

I often think of the people who never ask for help and wonder about what kinds of problems might be out there and how common without us knowing. I’ve worked with, and hav had longer and shorter coding sessions with quite a lot of people and use that as a way to learn about what people put up with. My experience is that people find it much harder to fix a broken structure than adapting to the help with protecting the structure. It might be extra much so with Calva, which relies on the structure a lot, though I am not sure about that, because LISP is what it is. The structure is part of the language paradigm. We are squeezed between a rock and a hard place. We have made the choice to follow the Tao of LISP, adhering to its structural requirements. (And it is also part of the Tao of Calva to assume that people can adapt.) It causes some friction, which we try to mitigate in some different ways: • When Calva detects that there is unbalance, it relaxes its strictness. There is a lot of room for improvement here, which we should close. • We make it easy to force delete with the alt/option modifier. • We make switching between strict and Cave Man mode as easy and discoverable as we can.. • We try to make it easy to select code in a structural way. • There is a Fire up the Getting Started REPL command that early on highlights this structure protection. https://calva.io/getting-started/ Maybe you can make an experiment this year, @lspector? Instead of conditioning your students into thinking that structure protection should be switched off first thing, have them start by using the Getting Started REPL feature and see if they pick up enough from it to overcome the unfamiliar behaviour.

Tero Matinlassi 2021-06-03T12:17:56.171500Z

I’m thinking it’s more about learning to edit in a structural way than Calva itself and I’m finding that quite difficult. I guess it might pay in the end, but not using paredit or similar things before makes the experience a bit hard, maybe especially if you’re learning a new language like Clojure as well. Could be too much at the time. I don’t say that it needs to be changed, on the contrary, I think emphasis on structural editing is a good thing even it might not suite for some people. Personally I have not turned strict mode off and resort to option+backspace quite often. 🙂 I’ve learned maybe one or two shortcuts for modifying the structure, I don’t know actually how many I will need to be really productive. Also keyboard shortcuts tend to collide easily with other programs which makes using them even harder.

lspector 2021-06-03T13:21:17.171700Z

@pez I will indeed think about how to introduce this, maybe not saying "turn this off!" but instead noting that it is on, and that it can be turned off easily, and pointing out the switch button. I appreciate that the button is there and easy to use, but FWIW it took me a long time to re-find it even though I knew all about it before, in part because I forgot what it was called. It looks like it is also not mentioned on the Getting Started doc page.

lspector 2021-06-03T13:24:59.171900Z

My experience helping students to fix broken structures is that the key is to have them use an environment with good auto-reindentation and make sure they are invoking it whenever they have a problem. And rainbow brackets also help a lot.

pez 2021-06-03T13:29:32.172100Z

A lot of things are not mentioned on the Getting Started page. 😄 The thing with alt+backspace is mentioned in the Getting Started REPL guide.

pez 2021-06-03T14:03:44.172300Z

@tero.matinlassi it certainly a thing with colliding shortcuts in the mix as well. As for how many paredit commands you need, depends on who you are. I tend to use these a lot: • slurp/barf • raise • splice • drag-forward/backward • kill to end of list I also use some move commands like: • forward/backward sexp • backward/forward-up sexp

lspector 2021-06-03T16:29:33.179600Z

Found the mention of alt+backspace . Pretty well buried! And if I understand correctly Windows users may not be able to get to that guide without jumping through hoops, right? FWIW I'd have it in the first paragraph of whatever getting started thing every new user will read, before they start to think that their keyboard has broken. I'd also include the pointer to the button for turning off strict mode there.

lspector 2021-06-03T16:37:01.179800Z

Also, in that guide (and anywhere else) it would be good to add to the mention of "Ctrl+Enter" something like ("or option+return on a mac"). Any friction on the path to "making it go" (and typing and editing) is particularly bad for new users. Mac users will look down, see no Enter key, maybe try control-return which does the wrong thing, then maybe if they are persistent finally find option-return, which works but they're not going to feel like they know what's going on.

pez 2021-06-03T18:59:31.186700Z

It’s ctrl+enteron both Mac and Windows. So if some Mac use tries ctrl+return instead, that will work and do the right thing. I do think most people are smart enough to know that return and enter is the same thing. If not, they are going to have a hard time learning to code anyway?

pez 2021-06-03T19:01:01.186900Z

About the Getting Started REPL on Windows, that is correct. There is a bug in Oracles Java install. We’ll work around it one of these days.

pez 2021-06-03T19:02:07.187100Z

But if anything, that should be mentioned early in the docs. “If you are on Windows, Oracle’s Java will mot work.”

pez 2021-06-03T19:10:24.187500Z

Regarding formatting your way out of broken structure. That doesn’t work in Calva, which needs the structure for ts formatting to work.

lspector 2021-06-03T19:49:29.188300Z

Ooo sorry for the confusion about ctrl+enter above -- I see that it was really Alt+enter that was in the docs, for which I had found that option+return works. I guess you're right that enter -> return is obvious enough, but FWIW I don't find Alt -> option to be automatic in my brain, and I suspect newcomers would appreciate an explicit note about this.

lspector 2021-06-03T19:54:08.188500Z

On formatting in a broken structure, alas I see that you are correct. Rainbow brackets work, but not re-indentation. I do rely on that in Cursive and other environments that I use, so that may prevent me from switching back to Calva (and save you from my incessant comments on beginner documentation 😀).

pez 2021-06-03T20:38:07.190200Z

I do hope you'll stay and keep advocating for the beginner experience.

lspector 2021-06-04T00:23:21.191600Z

Thanks @pez -- I really appreciate your receptiveness to suggestions!

Hukka 2021-06-03T06:58:08.167700Z

Yeah, sorry

borkdude 2021-06-03T09:57:56.168300Z

@pez Are you excited about your talk on Saturday yet? :-)

pez 2021-06-03T10:13:13.170100Z

Haha, @borkdude! I am certainly excited about the questions we will get after the presentation. 😃 This is the talk we are talking about, dear Calva-friends: https://www.linkedin.com/feed/update/urn:li:activity:6805741678591258624/

borkdude 2021-06-03T10:14:37.170500Z

Should we have received an e-mail where to log in etc?

pez 2021-06-03T10:14:53.170600Z

Please don’t hesitate to connect with me on LinkedIn, folks. I have discovered that making it a network of a lot of Clojure heads made LinkedIn valuable and fun for me.

pez 2021-06-03T10:15:14.171100Z

We should. There is some info about the lateness in #clojured

borkdude 2021-06-03T10:15:40.171200Z

I hardly ever look at linkedin, but I do accept Clojure-related people as connections, except recruiters

pez 2021-06-03T14:29:07.174Z

Also, folks: If you don’t think watching me make a fool of myself is enough to warrant attending clojureD, consider that you will also get to see @borkdude tell you how to make Your own fast, native Clojure scripting CLI with GraalVM and SCI!: https://clojured.de/schedule/#michielborkent

2
2021-06-03T14:41:24.174700Z

Will these videos be available afterwards (even for a price)? I'm going to be huffing and puffing my way up a big hill on Saturday

pez 2021-06-03T14:47:22.175500Z

The previous years are up on YouTube, so very likely that will happen this year as well.

leoiacovini 2021-06-03T15:21:48.178300Z

Hey folks 👋 I am having some trouble to run clojure.tools.namespace commands when inside Calva repl (started by the jack-in command), I noticed the refreshes weren’t working properly, and when looking further I found that for some reason when inside Calva, it’s not loading the classpath correctly, eg:

(clojure.java.classpath/classpath-directories) => ()
When running from a vanilla lein repl in terminal, this return the correct classpath directories. Do someone has a clue on what can be going on?

pez 2021-06-03T15:35:40.178400Z

See if adding your :repl profile to calva.myLeinProfiles helps.

leoiacovini 2021-06-03T15:45:07.178600Z

I don’t have a repl profile in my project, but I was starting Calva jackin with the same profiles I was using when starting from terminal. I tried some other stuff and found out that when connecting to a vanilla lein repl from terminal it returns the classpath correctly, but whe using the jack-in command sequence (with the nREPL middlewares) it stop getting the classpath correctly and returns an empty list

pez 2021-06-03T15:50:12.178800Z

Yeah, that’s strange. I was thinking maybe you have a :repl profile in your user directory, but it should be loaded automatically also with Jack-in, so that’s not what is going on.

pez 2021-06-03T15:51:28.179Z

When I try this I get:

; Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:435).
; clojure.java.classpath
Both in Calva and with lein repl

leoiacovini 2021-06-03T16:18:08.179300Z

Probably you need to have: https://github.com/clojure/java.classpath or https://github.com/clojure/tools.namespace (which brings it transitively)

sashton 2021-06-03T18:00:34.181800Z

What is a good option for viewing clojure test failure diffs? In Cursive, there is a popup diff viewer. I tried configuring humane test, but it had no effect.

sashton 2021-06-03T18:01:24.182600Z

I’m guessing because humane test even warns against using it with cider 0.11.0+

sashton 2021-06-03T18:02:22.183800Z

In my current workspace, the expected and actual outputs are being printed unformatted in calva-repl. It isn’t easy to spot the difference in the failure.

👍 1
borkdude 2021-06-03T18:24:15.184300Z

@sashton I believe the kaocha testing framework has such a diffing built-in

lread 2021-06-03T18:32:06.185900Z

The pretty diffs is my favourite feature of kaocha. There is also https://github.com/weavejester/eftest which does pretty diffs.

borkdude 2021-06-03T18:39:31.186200Z

those effing failing tests, is that where the name is based on?

bringe 2021-06-03T18:49:22.186400Z

I've started to prune my feed on there and am realizing I will like it more that way as well.

pez 2021-06-03T19:04:50.187300Z

Yeah, because reasons I have tons of contacts on LinkedIn that do not add to the value. I am now trying to overcrowd them with Clojure folks. 😃

1
leoiacovini 2021-06-03T19:19:27.187800Z

I think that it is related with this issue actually: https://github.com/clojure-emacs/orchard/issues/103 I tried on Java 8 and it’s fine, just Java 11 has this problem

pez 2021-06-03T19:26:08.188100Z

Ah. Thanks for sharing that find!

😄 1
bringe 2021-06-03T23:28:34.191300Z

@sashton There's an issue about integrating test diffing with Calva: https://github.com/BetterThanTomorrow/calva/issues/1007. Please comment if you have anything you'd like to add.