Fork me on GitHub
#nrepl
<
2020-04-12
>
pez11:04:02

If I place a breakpoint on line 8 here: https://github.com/PEZ/clojurecism/blob/master/meetup/src/meetup.clj#L8 things lock up when I evaluate something that should hit it.

bozhidar14:04:19

@pez Seems like a pretty ordinary function to me. Do you want me to test it in CIDER?

pez14:04:17

That’s what I did.

pez14:04:18

Calva is bug compatible. 😃

pez15:04:24

Should I file this as an issue?

bozhidar15:04:29

@pez Yep, you should.

bozhidar15:04:59

Actually, on second thought I think the problem is pretty simple. I assume you don’t set any print lenth limit, but (range) is infinite and and when you try to realize it in the debugger nothing good can come out of this.

bozhidar15:04:40

I’m wondering if it doesn’t make sense to add some special handling for range and other forms like it that we know are going to cause a lockup without some additional configuration.

pez15:04:24

Ah, I see. The thing is that the problem seemed a bit intermittent , so I never suspected the range thing, which we have discussed recently somewhere.

pez15:04:03

Maybe the default should be that the implementing side sets some non-locking print length?

bozhidar15:04:35

Well, that’s certainly an option, although I think it’s better for editor clients to set some default, as this is more visible to the end users. Otherwise they might wonder where some limit is coming from.

bozhidar15:04:59

> The thing is that the problem seemed a bit intermittent

bozhidar15:04:22

What happens when you step over it and it doesn’t blow up? Without some print limit I can’t expect how this can work in some cases. 🙂

pez15:04:39

With implementing side, I meant editor clients. 😃

bozhidar15:04:05

CIDER used to have separate print options configs for regular evaluation and for the debugger but at some point we folded those together .

bozhidar15:04:41

(defcustom cider-print-options nil
  "A map of options that will be passed to `cider-print-fn'.
Here's an example for `pprint':

  '((\"length\" 50) (\"right-margin\" 70))"
  :type 'list
  :group 'cider
  :package-version '(cider . "0.21.0"))

bozhidar15:04:46

You can add something like this.

bozhidar15:04:13

Funny enough, when those options had defaults people were complaining there were defaults, and when we removed them - people were complaining there were no defaults. 😄

pez15:04:55

I have had many moments like that with Calva!

pez15:04:26

But generally, Calva comes with a lot of defaults, so people are more used to it there. 😃

pez15:04:26

The intermittent thing might have been my testing. Probably was my testing. There were a lot of branches and versions involved... I easily get confused.

pez15:04:38

@brandon.ringe maybe we should consider debug defaults like ^ that ^? I might not be the only one not realizing the implications of attempting to realize and infinite sequence. 😃

bringe20:04:36

Yeah, or even a default that is used everywhere, like Bozhidar said. This is related to the large result set issue I think. So a fix there could fix the debug issue perhaps

bringe20:04:03

I think I saw this same issue being discussed elsewhere just the other day, in this slack workspace, but I don't remember where.

bringe20:04:22

Related to infinite sequences and print length

pez20:04:38

Same here. I know we discussed it somewhere, but where... a slack syndrome.

😄 4
pez20:04:23

But it makes sense to me to have a default of infinite generally, but for debug, something finite, and to have settings where both can be changed by the user.

bringe20:04:17

Yeah, more settings with reasonable defaults is usually better, imo

pez20:04:44

Less settings is my usual goto. 😃

pez20:04:51

But this does come to mind. https://youtu.be/QHZ48AE3TOI

😆 4