Fork me on GitHub
#cider
<
2018-12-17
>
dominicm06:12:22

Writing our own main would be cool 😊

dominicm06:12:31

Prove the idea

bozhidar06:12:27

Seems you’ve sorted this out by the time I came.

bozhidar07:12:19

Btw, the built-in interactive REPL in nREPL is not really meant for any serious use, as it’s mostly a proof-of-concept (a reference for people looking to implement something on top of nREPL). We can’t really depend on REPLy or rebel, but we can always check if they are present and use them if they are. I know that’s different from the discussion, so far, but I’m mentioning it as well, as another way to get a more capable REPL client.

dominicm07:12:38

I want both for edge. Nrepl client in the terminal is not especially appealing for local development. Rebel doesn't have an nrepl mode.

futuro19:12:22

@ackerleytng I use stump, and I handle any Ctrl-T mappings in programs by doing ctrl-t t to pass it in directly.

ackerleytng15:12:05

hi fellow stump user!! emacs' cider's test mappings all use C-t right?

futuro18:12:16

I believe so, though I don't use them because our tests use test-fn-name instead of fn-name-test, and I haven't had time to fix it lol.

futuro18:12:08

It might be possible to easily remap those bindings, though my emacs-fu isn't quite strong enough to know how.

ackerleytng14:12:31

i see, yup i don't think it's so straightforward haha

futuro14:12:19

What about a different top-level binding for stump?

futuro14:12:53

For tmux I rebound the ctrl key to ctrl-[ because I use ctrl-a to go to the beginning of the line, and that's been really helpful.

ackerleytng13:12:34

i'm trying out ctrl-i, but i'm finding it a little difficult to adapt to, also i guess because C-i needs both hands

futuro20:12:14

What about C-d?

futuro20:12:22

I guess that's "move down half a page" in readline

ackerleytng12:12:58

that's delete char in emacs! hahah

futuro19:12:46

If I had to use ctrl-t a lot, or if I found that cumbersome, I'd probably bind a different key, such as ctrl-[ as my main modifier.

futuro19:12:11

It hasn't bothered me enough yet to go about rebinding the main modifier, but that's what I did for tmux and ctrl-a (as I use readline constantly).

andnils20:12:38

Weird thing: I have run cider-jack-in-clj on a project. Then, I close the connection and run cider-jack-in-clj on a second project, and this project is of type clojure-cli (deps.edn) I get the following:

andnils20:12:13

This is cider-20181212.1936. No problem when running cider-18.0.

andnils20:12:35

Seems sesman-friendly-session-p called via cider-repls is involved...

kommen20:12:46

@U05542278 would be helpful to get a stacktrace (set to debug-on-error to t)

andnils21:12:11

meh...couldn't include the whole stacktrace so I had to trim it a bit...

andnils21:12:33

anyways, I haven't dug into the cider source before so it's new for me...

andnils21:12:51

saw some stuff about connect-sibling so I reckon that's why I get problem with the second connection

alexyakushev21:12:47

@bozhidar I've pushed out compliment 0.3.8, minus one blocker for 0.19 🙂

alexyakushev23:12:22

OK, this bothered me for a long while: if you evaluate something like this: ({:a} 1), CIDER will pop up a stacktrace saying Unmatched delimiter: ).

dpsutton23:12:07

[[email protected] clojure]$ clj
Clojure 1.9.0
user=> ({:a} 1)
RuntimeException Map literal must contain an even number of forms  clojure.lang.Util.runtimeException (Util.java:221)
1
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:221)
user=> 

seems par for the course

alexyakushev23:12:50

[cont] I understand it is the default REPL behavior to evaluate everything until the input is exhausted, but wouldn't it make more sense to short-circuit that the first time an error happens?

alexyakushev23:12:49

Makes it a real pain in the butt to look through a large function to find that one pesky odd-element map.

dpsutton23:12:22

do you mean this to be in #clojure-dev or here? seems like you want to change clojure?

alexyakushev23:12:22

Confusing as hell too, not to mention the beginners.

alexyakushev23:12:04

@dpsutton When that happens in regular Clojure REPL, at least you get all the errors at once. Also, it shows line/column then.

alexyakushev23:12:32

In CIDER though, only the last exception is displayed which doesn't make any sense.

alexyakushev23:12:14

Doesn't necessarily has to be a change to Clojure, might modify "eval" op as well.

dpsutton23:12:11

ah the first error message is not shown, just the unmatched delimiter

dpsutton23:12:19

i missed that part 🙂

alexyakushev23:12:28

AFAIU, it is probably expected for default Clojure REPL/socket REPL as it's sorta stream-oriented.

alexyakushev23:12:11

But since nREPL has a strictly defined concept of a "message", it should do no harm to discard the eval operation of the whole message at the first error.

dominicm23:12:52

If I recall correctly, multiple stacks are sent if available. I'm not sure what's happening to from this.

alexyakushev23:12:42

That's true, they are all sent, and I think they are actually rendered one after the other. But that happens in a rapid succession, so you only get to see the last one.

alexyakushev23:12:54

But I'd argue that the whole "read it till the end" approach is counter-intuitive and potentially dangerous.

alexyakushev23:12:10

As demonstrated in the default Clojure REPL:

user=> (defn send-rockets! [] (println "BOOM!"))
#'user/send-rockets!
user=> (comment {:a} (send-rockets!))
Syntax error reading source at (REPL:1:14).
Map literal must contain an even number of forms
BOOM!
nil
Syntax error reading source at (REPL:1:31).
Unmatched delimiter: )

dominicm23:12:42

> That's true, they are all sent, and I think they are actually rendered one after the other. But that happens in a rapid succession, so you only get to see the last one. Cider.el only shows one at a time, and provides no mechanism for backwards and forwards?

alexyakushev23:12:50

It does show all the lines in the REPL buffer, but only one stacktrace buffer is displayed, with the last error.