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...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=> It seems in this kind of interaction (multi-line mode), the client evals all but the last complete form?
I'm trying to match behavior in the Lingy repl client.
Clojurists don't write code in REPL itself, they send forms from their editors 🙂
@serioga that seems orthogonal. Are you trying to say that this isn't worth mentioning?
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. 🙂
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...
Fair. But this is #leiningen and seems like the right place to talk about lein repl issues.
To your point, perhaps lein repl startup should print a url to documentation that explains how to take advantage of better nREPL clients.
I can try forwarding this feedback to technomancy (primary maintainer of leiningen) real quick
Cheers 🙂
@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@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=> $ clj
Clojure 1.10.2
user=> (+ 1 2)
(+ 1 2)
3
user=>
this is super annoying$ clojure
Clojure 1.10.2
user=> (+ 1 2)
3
user=>
is fine and clj is just a bash script calling clojure with rlwrap$ clojure
Clojure 1.10.2
user=> (prn
1) (prn
1
nil
2)
2
nil
user=> $ rlwrap --version
rlwrap 0.43
from apt install rlwrap on Ubuntu 22.04@hifumi123 anything from technomancy?
Ah yeah, I have some logs from IRC
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
<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
@hifumi123 I'm on IRC. where is this?
#clojure on libera.chat
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
@hifumi123 what's your libera nick?
nashi74