leiningen

Ingy döt Net 2023-08-02T12:33:42.893629Z

I just noticed something interesting in the lein repl client interaction:

user=> (prn
  #_=> 1) (prn
  #_=> 2) (prn
1
nil
  #_=> 3) (prn
2
nil
  #_=> 4)
3
nil
4
nil
user=> 
I would expect the forms to eval as they became complete, but the lein repl delays this, but only for the first incomplete line...

Ingy döt Net 2023-08-02T12:34:24.907829Z

Also this addition to the first line:

user=> (prn 0) (prn
  #_=> 1) (prn
0
nil
  #_=> 2) (prn
1
nil
  #_=> 3)
2
nil
3
nil
user=> 

Ingy döt Net 2023-08-02T12:36:30.843239Z

It seems in this kind of interaction (multi-line mode), the client evals all but the last complete form?

Ingy döt Net 2023-08-02T12:37:31.965699Z

I'm trying to match behavior in the Lingy repl client.

serioga 2023-08-02T12:44:40.197099Z

Clojurists don't write code in REPL itself, they send forms from their editors 🙂

Ingy döt Net 2023-08-02T14:22:40.776669Z

@serioga that seems orthogonal. Are you trying to say that this isn't worth mentioning?

🤷‍♂️ 1
Ingy döt Net 2023-08-02T14:34:59.608889Z

From my pov lein repl probably accounts for most people's first interactions with Clojure. It's unlikely that people care much about this level of corner cases, but having things work nicely in a first-experience environment is good for keeping people interested. I don't think this is anything that needs a lot of attention, but thought it was an oddity worth bringing up. 🙂

serioga 2023-08-02T14:39:03.813889Z

imho when someone starts learning Clojure in such a REPL they can get bad experience because of lack of ergonomics. Then they can decide that repl-driven development is overrated and avoid using REPL what is big mistake...

Ingy döt Net 2023-08-02T15:03:41.121339Z

Fair. But this is #leiningen and seems like the right place to talk about lein repl issues.

Ingy döt Net 2023-08-02T15:04:51.180299Z

To your point, perhaps lein repl startup should print a url to documentation that explains how to take advantage of better nREPL clients.

2
hifumi123 2023-08-02T17:44:24.682229Z

I can try forwarding this feedback to technomancy (primary maintainer of leiningen) real quick

Ingy döt Net 2023-08-02T17:45:30.582049Z

Cheers 🙂

2023-08-03T07:24:18.950429Z

@ingy Not sure if relevant, but the repl from the cljhttps://clojure.org/guides/install_clojure seems to get this right

clj
Clojure 1.11.1
user=> (prn
1) (prn
1
nil
2) (prn
2
nil
3) (prn
3
nil
4)
4
nil

Ingy döt Net 2023-08-03T22:25:51.514599Z

@jeroenvandijk I finally got a clj installed and it does seen to evaluate as expected. But for some reason (I'm pretty sure due to rlwrap) it is echoing every input line I enter

$ clj
Clojure 1.10.2
user=> (prn
(prn
1) (prn
1) (prn
1
nil
2) (prn
2) (prn
2
nil
3)
3)
3
nil
user=> 

Ingy döt Net 2023-08-03T22:26:31.270579Z

$ clj
Clojure 1.10.2
user=> (+ 1 2)
(+ 1 2)
3
user=> 
this is super annoying

Ingy döt Net 2023-08-03T22:29:22.762109Z

$ clojure
Clojure 1.10.2
user=> (+ 1 2) 
3
user=> 
is fine and clj is just a bash script calling clojure with rlwrap

Ingy döt Net 2023-08-03T22:30:08.430099Z

$ clojure
Clojure 1.10.2
user=> (prn
1) (prn
1
nil
2)
2
nil
user=> 

Ingy döt Net 2023-08-03T22:35:10.583999Z

$ rlwrap --version
rlwrap 0.43
from apt install rlwrap on Ubuntu 22.04

Ingy döt Net 2023-08-03T22:37:37.892649Z

@hifumi123 anything from technomancy?

hifumi123 2023-08-03T22:38:57.436469Z

Ah yeah, I have some logs from IRC

hifumi123 2023-08-03T22:39:42.105469Z

Some people recommended setting up “rebel readline” for a better terminal experience. It offers autocomplete and some other amenities AFAICT https://github.com/bhauman/rebel-readline#leiningen

🙌 1
hifumi123 2023-08-03T22:40:23.647039Z

<technomancy> I'd say probably it'd be appropriate for the docs to point you in the direction of a more integrated repl client, but not the message that shows every time you start the repl
<technomancy> because using a more integrated repl client *does* involve running `lein repl` so even if you followed its instructions it would still be telling you to do things differently which is weird

Ingy döt Net 2023-08-03T22:45:49.870379Z

@hifumi123 I'm on IRC. where is this?

hifumi123 2023-08-03T22:46:16.048769Z

#clojure on libera.chat

hifumi123 2023-08-03T22:47:09.820469Z

If you are new to libera.chat, you may want to get a cloak first (cf. https://libera.chat/guides/cloaks) so that people cant see your IP address or hostname

Ingy döt Net 2023-08-03T22:48:47.006359Z

@hifumi123 what's your libera nick?

hifumi123 2023-08-03T22:49:05.731839Z

nashi74