tizoc / shen-scheme

Shen/Scheme implementation
Other
99 stars 8 forks source link

Exiting from shen-scheme? #17

Open doug719 opened 3 years ago

doug719 commented 3 years ago

chez scheme allows an exit with CTRL-d. I have tried this, (cl.exit) (scheme.exit) (exit) and (chez.exit), but none worked. Using CTRL-c to exit does not seem graceful or correct.

tizoc commented 3 years ago

@doug719 (scm.exit). Btw, you can access all Chez functions by using the scm. prefix.

doug719 commented 3 years ago

Hello Bruno, Yes (scm. exit) does work, but I would like to request a more intuitive and graceful exit.  You should not have to enter a chez scheme  command to exit shen.  Something like CTRL-d, (exit),  (scheme.exit), or (shen.exit) seems a lot more natural to me, and not have to enter something that depends on the implementation language. Regards,Doug

On Wednesday, April 28, 2021, 9:10:03 AM MDT, Bruno Deferrari ***@***.***> wrote:  

@doug719 (scm.exit). Btw, you can access all Chez functions by using the scm. prefix.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

doug719 commented 3 years ago

Bruno, I do realize that shen-cl has an exit of (cl.exit).  But I think any of my suggestions would be better than (scm. exit), which is not very shen like.  Please consider it a suggested improvement.  I can always implement my suggestion in a utilities file. Regards,Doug

On Wednesday, April 28, 2021, 9:31:12 AM MDT, T.D. Telford ***@***.***> wrote:  

Hello Bruno, Yes (scm. exit) does work, but I would like to request a more intuitive and graceful exit.  You should not have to enter a chez scheme  command to exit shen.  Something like CTRL-d, (exit),  (scheme.exit), or (shen.exit) seems a lot more natural to me, and not have to enter something that depends on the implementation language. Regards,Doug

On Wednesday, April 28, 2021, 9:10:03 AM MDT, Bruno Deferrari ***@***.***> wrote:  

@doug719 (scm.exit). Btw, you can access all Chez functions by using the scm. prefix.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

doug719 commented 3 years ago

Bruno, I mistakenly replied to the predicate discussion with the following (it of course should be part of the exit discussion). All of the schemes implementations and lisp implementations  that I know of (including sbcl) exit on a CTRL-d.  I would think that since shen is part of the lisp family, it would also allow this. Regards,Doug

On Wednesday, April 28, 2021, 9:37:48 AM MDT, T.D. Telford ***@***.***> wrote:  

Bruno, I do realize that shen-cl has an exit of (cl.exit).  But I think any of my suggestions would be better than (scm. exit), which is not very shen like.  Please consider it a suggested improvement.  I can always implement my suggestion in a utilities file. Regards,Doug

On Wednesday, April 28, 2021, 9:31:12 AM MDT, T.D. Telford ***@***.***> wrote:  

Hello Bruno, Yes (scm. exit) does work, but I would like to request a more intuitive and graceful exit.  You should not have to enter a chez scheme  command to exit shen.  Something like CTRL-d, (exit),  (scheme.exit), or (shen.exit) seems a lot more natural to me, and not have to enter something that depends on the implementation language. Regards,Doug

On Wednesday, April 28, 2021, 9:10:03 AM MDT, Bruno Deferrari ***@***.***> wrote:  

@doug719 (scm.exit). Btw, you can access all Chez functions by using the scm. prefix.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

doug719 commented 3 years ago

Hello Bruno, First, is this the correct email address for questions? I frequently want to edit a previous line input to shen.  On all of the scheme and lisp implementations that I have tried, I use rlwrap to get previous lines if they do not have a readline capability.

rlwrap works on shen-cl, but does not work on shen-scheme Also, If  I use %3 to get the previous input on command 3, on shen-cl it just shows the previous command, but does not allow me to edit it. on shen-scheme I get (4-) %3

  1. (load "lists.scm")
  2. (load "lists.scm") Exception in abort:

Can you fix shen-scheme to work with rlwrap, or provide a way to recall and edit previous commands? Regards,Doug

tizoc commented 3 years ago

I agree about the ctrl-d issue, will look into it when I have time.

Regarding rlwrap, not sure why %N doesn't work (not even sure what it does internally). The Shen REPL provides !3 to repeat the command at prompt 3, although it is not exactly what you want (if I understood you right, the rlwrap version lets you edit the command).

doug719 commented 3 years ago

Hello Bruno, Yes, rlwrap recalls the desired command and lets you edit it (readline or emacs type commands).  I find it to be necessary. Some of us are not perfect and re-editing of the command is necessary. Regards,Doug

On Thursday, April 29, 2021, 7:20:06 AM MDT, Bruno Deferrari ***@***.***> wrote:  

I agree about the ctrl-d issue, will look into it when I have time.

Regarding rlwrap, not sure why %N doesn't work (not even sure what it does internally). The Shen REPL provides !3 to repeat the command at prompt 3, although it is not exactly what you want (if I understood you right, the rlwrap version lets you edit the command).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

felixr commented 2 years ago

FYI, if you use rlwrap you can specific key bindings fro shen-scheme in your .inputrc. eg.:

$if shen-scheme 
  "\C-e": '(scm.exit)\C-m'
$endif

This will let you exit with Ctrl-e. I don't think you can re-bind Ctrl-d though.