You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a small(ish) issue while putting the new Guile client through its paces. Steps to reproduce:
Open new file, connect client etc. Verify correct operation by sending some test forms.
Place the cursor on an empty line in the file, with another empty line below
Enter visual selection mode with v, press down/j to select just the newline character
Send visual selection to Conjure with <LocalLeader>E
Attempt to send the same test forms as in step 1.
Expected outcome: the new evaluations proceed exactly as before.
Actual outcome: no further Conjure output until client is disconnected and reconnected with <LocalLeader>cd followed by <LocalLeader>cc.
Complete log output is below, but I think what's happening is that Conjure is waiting for a new prompt in response to the newline, as you would expect to see if you were to press enter on an empty line in a REPL. However, the socket REPL behaves differently. Connecting to the socket (using nc -U ~/starlet/guile.socket), then pressing enter on an empty line, does not produce a new prompt. Entering any kind of expression (e.g. 1) results in a normal evaluation and a new prompt:
$ nc -U ~/starlet/guile.socket
GNU Guile 3.0.4.25-de5d1
Copyright (C) 1995-2020 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guile-user)> (+ 1 2)
$21 = 3
scheme@(guile-user)> <----- press enter a few times
1
$22 = 1
scheme@(guile-user)> (+ 2 3)
$23 = 5
scheme@(guile-user)>
Sending a single newline is a somewhat contrived example of course, but I came across the problem while trying to evaluate bigger blocks of code - any trailing newline causes the problem. A simple fix would be to strip out any trailing newlines before sending anything to the REPL. This filtering could be specific to the Guile client, or more global. Hopefully other socket-based REPLs have better behaviour!
Complete Conjure log output with debug:
; Sponsored by @penryu ❤
",m (guile-user)\
"
; --------------------------------------------------------------------------------
; /home/taw/starlet/guile.socket (connected)
; debug: receive
"GNU Guile 3.0.4.25-de5d1\
Copyright (C) 1995-2020 Free Software Foundation, Inc.\
\
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.\
This program is free software, and you are welcome to redistribute it\
under certain conditions; type `,show c' for details.\
\
Enter `,help' for help.\
scheme@(guile-user)> scheme@(guile-user)> "
; debug: send
",m (guile-user)\
"
; debug: receive
"scheme@(guile-user)> "
; --------------------------------------------------------------------------------
; eval (root-form): (use-modules (srfi srfi-1))
; debug: send
"(use-modules (srfi srfi-1))"
; debug: receive
"scheme@(guile-user)> "
; Empty result
; --------------------------------------------------------------------------------
; eval (root-form): (display "Hello\n")
; debug: send
"(display \"Hello\\n\")"
; debug: receive
"Hello\
"
; debug: receive
"Hello\
scheme@(guile-user)> "
; Empty result
; --------------------------------------------------------------------------------
; eval (root-form): (+ 1 2)
; debug: send
"(+ 1 2)"
; debug: receive
"$18 = "
; debug: receive
"$18 = 3\
scheme@(guile-user)> "
3
; --------------------------------------------------------------------------------
; eval (selection):
; debug: send
"\
"
; --------------------------------------------------------------------------------
; eval (root-form): (+ 1 2)
; --------------------------------------------------------------------------------
; eval (root-form): (display "Hello\n")
; --------------------------------------------------------------------------------
; eval (root-form): (+ 1 2)
The text was updated successfully, but these errors were encountered:
Thanks for spotting this! Should be fixed on develop, I'm trimming the code strings down before sending them now and then just not doing it if it's blank. So sending just whitespace won't do anything now.
Guile's REPL doesn't display a new prompt on whitespace + new line, unlike basically every other REPL I can think of 😅
Thanks, seems to be fixed 100%!
Yeah, the different REPL behaviour took me by surprise as well. It's even different within a single Guile process between the terminal REPL and the socket REPL. I'm not sure why, even after looking at the code - maybe it's not intentional.
I found a small(ish) issue while putting the new Guile client through its paces. Steps to reproduce:
v
, press down/j
to select just the newline character<LocalLeader>E
Expected outcome: the new evaluations proceed exactly as before.
Actual outcome: no further Conjure output until client is disconnected and reconnected with
<LocalLeader>cd
followed by<LocalLeader>cc
.Complete log output is below, but I think what's happening is that Conjure is waiting for a new prompt in response to the newline, as you would expect to see if you were to press enter on an empty line in a REPL. However, the socket REPL behaves differently. Connecting to the socket (using
nc -U ~/starlet/guile.socket
), then pressing enter on an empty line, does not produce a new prompt. Entering any kind of expression (e.g.1
) results in a normal evaluation and a new prompt:Sending a single newline is a somewhat contrived example of course, but I came across the problem while trying to evaluate bigger blocks of code - any trailing newline causes the problem. A simple fix would be to strip out any trailing newlines before sending anything to the REPL. This filtering could be specific to the Guile client, or more global. Hopefully other socket-based REPLs have better behaviour!
Complete Conjure log output with debug:
The text was updated successfully, but these errors were encountered: