Home > Archive > Scheme > January 2006 > interactive scheme
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
interactive scheme
|
|
| Tydr Schnubbis 2006-01-28, 7:56 am |
| Is there a good interactive Scheme interpreter available somewhere?
Something that makes it easy to try out simple things, and has a usable
command history function. Something like Python's IDLE.
I've tried Chicken scheme and DrScheme, but I didn't quite like them. I
don't want to have to retype a 10-line procedure just because I made a
small mistake. Or do I have to resort to non-interactive use for trying
out things while I'm learning scheme?
| |
| Jens Axel Søgaard 2006-01-28, 7:56 am |
| Tydr Schnubbis wrote:
> Is there a good interactive Scheme interpreter available somewhere?
> Something that makes it easy to try out simple things, and has a usable
> command history function. Something like Python's IDLE.
>
> I've tried Chicken scheme and DrScheme, but I didn't quite like them. I
> don't want to have to retype a 10-line procedure just because I made a
> small mistake. Or do I have to resort to non-interactive use for trying
> out things while I'm learning scheme?
Gambit has a nice REPL.
But I have this feeling, that you must have overlooked something in
both Chicken and DrScheme.
Repeatedly pressing ctrl+p (for previously) will get you
the previously entered expressions in the DrScheme interaction
window. Copying s-expressions is done by placing the cursor
before the parenthesis pressing alt+rightarrow alt-c and then
alt-v where you want to insert it.
Also both Chicken and MzScheme support GNU readline:
<http://www.call-with-current-contin...s/readline.html>
<http://svn.plt-scheme.org/plt/trunk...eadline/doc.txt>
For the mzscheme one use the svn-version. [Is this neccessary?]
--
Jens Axel Søgaard
| |
| Pascal Bourguignon 2006-01-28, 7:56 am |
| Tydr Schnubbis <fake@address.dude> writes:
> Is there a good interactive Scheme interpreter available somewhere?
> Something that makes it easy to try out simple things, and has a
> usable command history function. Something like Python's IDLE.
>
> I've tried Chicken scheme and DrScheme, but I didn't quite like them.
> I don't want to have to retype a 10-line procedure just because I made
> a small mistake. Or do I have to resort to non-interactive use for
> trying out things while I'm learning scheme?
You could try mzscheme inside an emacs inferior-lisp buffer.
I actually use most often pseudo-scheme (a r4rs running on Common
Lisp) in my clisp running in an emacs inferior-lisp buffer. You
benefit from the standard emacs editing and comint history.
In emacs, there's also slime, and its swank module that has been
ported to one scheme implementation.
--
__Pascal Bourguignon__ http://www.informatimago.com/
"Debugging? Klingons do not debug! Our software does not coddle the
weak."
| |
| Eli Barzilay 2006-01-28, 7:05 pm |
| Jens Axel Søgaard <usenet@soegaard.net> writes:
> But I have this feeling, that you must have overlooked something in
> both Chicken and DrScheme.
Seems like you're using v20x:
> Repeatedly pressing ctrl+p (for previously)
ESC p
> will get you the previously entered expressions in the DrScheme
> interaction window. Copying s-expressions is done by placing the
> cursor before the parenthesis pressing alt+rightarrow alt-c
Alt+Shift+Right Ctrl+c
> and then alt-v where you want to insert it.
Ctrl+v
> Also both Chicken and MzScheme support GNU readline:
>
> <http://www.call-with-current-contin...s/readline.html>
> <http://svn.plt-scheme.org/plt/trunk...eadline/doc.txt>
>
> For the mzscheme one use the svn-version. [Is this neccessary?]
It's GPL'd, so cannot be distributed with the rest.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Jens Axel Søgaard 2006-01-28, 7:05 pm |
| Eli Barzilay wrote:
> Jens Axel Søgaard <usenet@soegaard.net> writes:
>
>
> Seems like you're using v20x:
>
>
> ESC p
Old habits...
Apropos once upon a time ctrl+up worked - I kinda liked that.
>
> It's GPL'd, so cannot be distributed with the rest.
Hmm. How about a download-readline collection then, to make
it easier to add it?
--
Jens Axel Søgaard
| |
| Nils O. Selåsdal 2006-01-28, 7:05 pm |
| Jens Axel Søgaard wrote:
> Eli Barzilay wrote:
>
> Old habits...
>
> Apropos once upon a time ctrl+up worked - I kinda liked that.
>
>
> Hmm. How about a download-readline collection then, to make
> it easier to add it?
Or incorporate editline, which is
"A BSD-licensed replacement for GNU Readline".
| |
| Ulrich Hobelmann 2006-01-28, 7:05 pm |
| Jens Axel Søgaard wrote:
> Hmm. How about a download-readline collection then, to make
> it easier to add it?
I use rlwrap for just about anything. No need to recompile anything
with readline. Just call any program, whether it's GPL, BSD, or
proprietary.
It even saves one history file for whatever program you call it with.
--
Suffering from Gates-induced brain leakage...
| |
| Ulrich Hobelmann 2006-01-28, 7:05 pm |
| Nils O. Selåsdal wrote:
> Or incorporate editline, which is
> "A BSD-licensed replacement for GNU Readline".
Hm, my Mac has both that, and Ruby and other programs installed, but
nonetheless neither Ruby itself uses it, nor can I compile rlwrap with
the editline lib. I had to install readline 5.
--
Suffering from Gates-induced brain leakage...
| |
| Eli Barzilay 2006-01-28, 7:05 pm |
| Jens Axel Søgaard <usenet@soegaard.net> writes:
>
> Hmm. How about a download-readline collection then, to make it
> easier to add it?
It's easy to bundle a separate .plt file, but we have an LGPL for
everything, so this would be difficult.
"Nils O. Selåsdal" <noselasd@asgaard.homelinux.org> writes:
> Or incorporate editline, which is
> "A BSD-licensed replacement for GNU Readline".
I only heard about it recently. Perhaps it would be a good solution.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Lauri Alanko 2006-01-28, 7:05 pm |
| For reasonable line-editing and command history, you can use ledit (or
other similar tools) on top of any terminal-based applications.
I run most interactive command-line applications through a wrapper
like this:
#!/bin/sh
if [ "x$TERM" = "xemacs" -o "x$TERM" = "xdumb" ]; then
exec "$@"
elif tty -s; then
exec /usr/bin/ledit -x -h $HOME/.`basename $1`-history "$@"
else
exec "$@"
fi
This way I get application-specific persistent command histories.
HTH.
Lauri
| |
| Marcin 'Qrczak' Kowalczyk 2006-01-28, 7:05 pm |
| "Nils O. Selåsdal" <noselasd@asgaard.homelinux.org> writes:
> Or incorporate editline, which is
> "A BSD-licensed replacement for GNU Readline".
BTW, editline doesn't seem to support UTF-8, so I prefer readline
whenever the license allows.
--
__("< Marcin Kowalczyk
\__/ qrczak@knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/
| |
| netytan 2006-01-28, 7:05 pm |
| There is also Petite/Chez Scheme with SWL, which is very similar to
IDLE. It has a nice history facility and all of the utilities necessary
to get around your code quickly while maintaining a VERY small
footprint.
The only bad thing about Chez Scheme is that it's proprietary. That
said petite is free and very high quality - it's also very portable
:).
http://www.scheme.com/
Mark.
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Jens Axel Søgaard wrote:
> Tydr Schnubbis wrote:
>
> Gambit has a nice REPL.
>
> But I have this feeling, that you must have overlooked something in
> both Chicken and DrScheme.
I don't think I've overlooked anything in Chicken. And ctrl-p in
DrScheme opens the print dialog. I've compiled gambit with msys and
mingw32, but the interactive mode just exits when I try to execute a
command. Something about a network error is all I'm able to read vefore
the window closes. Is there any chance that GUIDE will work, if I
compile that?
>
> Repeatedly pressing ctrl+p (for previously) will get you
> the previously entered expressions in the DrScheme interaction
> window. Copying s-expressions is done by placing the cursor
> before the parenthesis pressing alt+rightarrow alt-c and then
> alt-v where you want to insert it.
>
> Also both Chicken and MzScheme support GNU readline:
>
> <http://www.call-with-current-contin...s/readline.html>
> <http://svn.plt-scheme.org/plt/trunk...eadline/doc.txt>
>
> For the mzscheme one use the svn-version. [Is this neccessary?]
>
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Pascal Bourguignon wrote:
> Tydr Schnubbis <fake@address.dude> writes:
>
>
> You could try mzscheme inside an emacs inferior-lisp buffer.
>
> I actually use most often pseudo-scheme (a r4rs running on Common
> Lisp) in my clisp running in an emacs inferior-lisp buffer. You
> benefit from the standard emacs editing and comint history.
>
> In emacs, there's also slime, and its swank module that has been
> ported to one scheme implementation.
>
I forgot to mention I'm on Windows...
My unix/emacs days are over, and I'm not going back.
| |
| Arctic Fidelity 2006-01-28, 9:58 pm |
| On Sat, 28 Jan 2006 19:58:22 -0600, Tydr Schnubbis <fake@address.dude>
wrote:
> Jens Axel Søgaard wrote:
>
> I don't think I've overlooked anything in Chicken. And ctrl-p in
> DrScheme opens the print dialog. I've compiled gambit with msys and
> mingw32, but the interactive mode just exits when I try to execute a
> command. Something about a network error is all I'm able to read vefore
> the window closes. Is there any chance that GUIDE will work, if I
> compile that?
Well, I believe that someone said that the history was ESC-p in DrScheme,
and not CTRL-p. I don't know, but I am very certain that there is a
command history in DrScheme. And if there isn't, the definitions window
and the REPL are so convenient to move back and forth between that you
could easily work with that in lieu of a history.
- Arctic
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| netytan wrote:
> There is also Petite/Chez Scheme with SWL, which is very similar to
> IDLE. It has a nice history facility and all of the utilities necessary
> to get around your code quickly while maintaining a VERY small
> footprint.
>
> The only bad thing about Chez Scheme is that it's proprietary. That
> said petite is free and very high quality - it's also very portable
> :).
>
> http://www.scheme.com/
>
> Mark.
>
I tried it a few days ago, and gave up. Can't remember why. It either
didn't run, or its 'nice history facility' was to obscure for me to find
it. I use Windows, so there's no readline or anything of that kind.
Which probably means it has to use gtk or something to be usable, since
windows terminal windows suck.
| |
| Arctic Fidelity 2006-01-28, 9:58 pm |
| On Sat, 28 Jan 2006 20:05:50 -0600, Tydr Schnubbis <fake@address.dude>
wrote:
> Pascal Bourguignon wrote:
> I forgot to mention I'm on Windows...
>
> My unix/emacs days are over, and I'm not going back.
Oh what? You don't like Emacs? :-P If you want to know the truth, I find
working with Emacs in Windows to be much easier and more productive (by
utilizing paredit.el) than using some other IDE like DrScheme. I don't
know what you plan to do though, so I don't know if that fits what you
want to do. Emacs really is a pretty powerful and easy to use regarding an
inferior-scheme buffer.
- Arctic
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Eli Barzilay wrote:
> Jens Axel Søgaard <usenet@soegaard.net> writes:
>
>
> Seems like you're using v20x:
>
>
> ESC p
Thanks, this actually works. The same command can be activated by
pressing m:p, according to the shortcut list. Any idea what 'm' is?
It's not alt or ctrl.
>
>
> Alt+Shift+Right Ctrl+c
>
>
> Ctrl+v
>
>
> It's GPL'd, so cannot be distributed with the rest.
>
| |
| Arctic Fidelity 2006-01-28, 9:58 pm |
| On Sat, 28 Jan 2006 06:28:40 -0600, Tydr Schnubbis <fake@address.dude>
wrote:
> Is there a good interactive Scheme interpreter available somewhere?
> Something that makes it easy to try out simple things, and has a usable
> command history function. Something like Python's IDLE.
>
> I've tried Chicken scheme and DrScheme, but I didn't quite like them. I
> don't want to have to retype a 10-line procedure just because I made a
> small mistake. Or do I have to resort to non-interactive use for trying
> out things while I'm learning scheme?
I don't think you'll have to resort to anything like that. I constantly
use the REPL for testing and playing around. I do not have experience with
Chicken, but I am almost positive that DrScheme has a history mechanism.
As well, there is SCM, which I think also works on Windows, and you could
try that out. I don't remember whether it has a history mechanism or not,
but it's small and fast.
Now, what I am currently using is Petite Chez with Emacs on Windowx XP. I
find the Scheme buffer in Emacs to work really well. On the other hand, I
just tried out the main console interface and there is a history mechanism
(if only going up and down from what I can see) in the REPL. You could try
it out and see if that doesn't fit your fancy.
- Arctic
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
| |
| Eli Barzilay 2006-01-28, 9:58 pm |
| Tydr Schnubbis <fake@address.dude> writes:
> Eli Barzilay wrote:
>
>
> Thanks, this actually works. The same command can be activated by
> pressing m:p, according to the shortcut list. Any idea what 'm' is?
> It's not alt or ctrl.
It's `meta' which translates to `Escape' in DrScheme.
BTW, if you're using Windows, then (IIRC) anything that runs in a dos
box can use the built in editing facilities (like f3 etc).
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Arctic Fidelity wrote:
> On Sat, 28 Jan 2006 20:05:50 -0600, Tydr Schnubbis <fake@address.dude>
> wrote:
>
>
> Oh what? You don't like Emacs? :-P If you want to know the truth, I find
> working with Emacs in Windows to be much easier and more productive (by
> utilizing paredit.el) than using some other IDE like DrScheme. I don't
> know what you plan to do though, so I don't know if that fits what you
> want to do. Emacs really is a pretty powerful and easy to use regarding an
> inferior-scheme buffer.
>
> - Arctic
>
I'm watching the Abelson/Sussman Scheme lectures, and I just want to try
out basic stuff while I'm learning. I'm not going to actually use
scheme for anything useful. No plans yet, anyway.
http://swiss.csail.mit.edu/classes/...ssman-lectures/
About emacs, I guess I'm just being lazy for using visual studio instead
(for C/C++). But I guess you think call browsers, class browsers, and
graphical debuggers are for chickens...
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Eli Barzilay wrote:
> Tydr Schnubbis <fake@address.dude> writes:
>
>
> It's `meta' which translates to `Escape' in DrScheme.
>
>
> BTW, if you're using Windows, then (IIRC) anything that runs in a dos
> box can use the built in editing facilities (like f3 etc).
>
Sure, but that only gives you single-line command history. Which is
pretty useless for coding.
| |
| Eli Barzilay 2006-01-28, 9:58 pm |
| Tydr Schnubbis <fake@address.dude> writes:
> Eli Barzilay wrote:
>
> Sure, but that only gives you single-line command history. Which is
> pretty useless for coding.
I'm pretty sure that there was a way to use the arrows for a few lines
of history. I just tried it, it seems to be working for at least 40
lines of history (then I got bored).
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Arctic Fidelity 2006-01-28, 9:58 pm |
| On Sat, 28 Jan 2006 20:20:47 -0600, Tydr Schnubbis <fake@address.dude>
wrote:
> Arctic Fidelity wrote:
> I'm watching the Abelson/Sussman Scheme lectures, and I just want to try
> out basic stuff while I'm learning. I'm not going to actually use
> scheme for anything useful. No plans yet, anyway.
Well, if you are just trying stuff out, then I am pretty sure Chez and
many others have enough of a history for that.
> About emacs, I guess I'm just being lazy for using visual studio instead
> (for C/C++). But I guess you think call browsers, class browsers, and
> graphical debuggers are for chickens...
Hah, well, from what I saw of Visual Studio, honestly, I thought it was a
lot more work compared to what I was doing. Granted, I didn't get very
deep into it, but it seemed like someone took a bunch of buttons, gave
them random, obfuscated names, put them all in a hat, and then tossed the
hat onto a grid and called it Visual Studio. :-P
Then again, I think there is a little different method that one uses when
working with Scheme over C. When I am programming in C, I do in fact have
a graphical debugger and some other things that make life nice and easy.
But whenever I program in Scheme, I usually find that much of the extra
"features" of something like Visual Studio just seem to create a lot of
cruft for what I want to do. I do find the graphical "trace" lines in
DrScheme to be pretty convenient though. I do find MIT Scheme's debugger
to be really nice. I plan on expirementing more with Chez's debugger to
see if it has anything I like in it.
And I agree with you, I don't really like Emacs either, but I can't beat
it (yet) for developing Lisp code. :-)
- Arctic
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Eli Barzilay wrote:
> Tydr Schnubbis <fake@address.dude> writes:
>
>
> I'm pretty sure that there was a way to use the arrows for a few lines
> of history. I just tried it, it seems to be working for at least 40
> lines of history (then I got bored).
>
Oh, sorry. I guess I should have explained better what I meant. I
meant that one history level should be able to contain more than a
single line. So if I press the prev-history key, I should be able to
get a complete multi-line function definition. Then I'm able to correct
a mistake and submit it to the interpreter again.
If I write this:
(define (square x)
(x * x))
and the interactice environment says 'syntax error line 2' or something,
I should be able to just change the second line and resubmit it, without
having to retype the lines that were correct from the beginning.
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Tydr Schnubbis wrote:
> Eli Barzilay wrote:
> Oh, sorry. I guess I should have explained better what I meant. I
> meant that one history level should be able to contain more than a
> single line. So if I press the prev-history key, I should be able to
> get a complete multi-line function definition. Then I'm able to correct
> a mistake and submit it to the interpreter again.
>
> If I write this:
>
>
> (define (square x)
> (x * x))
>
> and the interactice environment says 'syntax error line 2' or something,
> I should be able to just change the second line and resubmit it, without
> having to retype the lines that were correct from the beginning.
But I guess this is what the upper part of the DrScheme window is for?
I'm about to check it out now.
| |
| Eli Barzilay 2006-01-28, 9:58 pm |
| Tydr Schnubbis <fake@address.dude> writes:
> If I write this:
>
> (define (square x)
> (x * x))
>
> and the interactice environment says 'syntax error line 2' or
> something, I should be able to just change the second line and
> resubmit it, without having to retype the lines that were correct
> from the beginning.
In that case you really do need something like Emacs or DrScheme.
(I think that even in Emacs you'll have some problems with this, you'd
probably end up using Scheme mode and whatever key combination sends
the current expression to the inferior Scheme process.)
Tydr Schnubbis <fake@address.dude> writes:
> But I guess this is what the upper part of the DrScheme window is
> for? I'm about to check it out now.
Yes -- you write definitions at the top, and everytime you click `run'
it evaluates them in a clean environment.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Eli Barzilay wrote:
> Tydr Schnubbis <fake@address.dude> writes:
>
>
> In that case you really do need something like Emacs or DrScheme.
> (I think that even in Emacs you'll have some problems with this, you'd
> probably end up using Scheme mode and whatever key combination sends
> the current expression to the inferior Scheme process.)
>
>
> Tydr Schnubbis <fake@address.dude> writes:
>
>
> Yes -- you write definitions at the top, and everytime you click `run'
> it evaluates them in a clean environment.
>
According to the docs, there is supposed to be a 'step' button above the
definitions window. Is there a trick to enable it, or is it just broken
in DrSceme 301?
| |
| Tydr Schnubbis 2006-01-28, 9:58 pm |
| Tydr Schnubbis wrote:
> Eli Barzilay wrote:
> According to the docs, there is supposed to be a 'step' button above the
> definitions window. Is there a trick to enable it, or is it just broken
> in DrSceme 301?
Ok, it just doesn't show up in advanced mode. But in the other modes,
'case' doesn't work. Oh, well.
| |
| netytan 2006-01-29, 3:57 am |
| You just download the SWL (Tk) extensions though they may well be
installed by default on Windows. Not sure how pressing up or down on
your keyboard is too obscure to you but might want to take another
look, it's really simple and is available on Windows :).
I haven't seen any other good IDE's for Scheme besides DrScheme; emacs
just doesn't seem to be up to scratch after using it with CL.
Take care,
Mark.
| |
| rsheridan6@gmail.com 2006-01-29, 3:57 am |
|
Tydr Schnubbis wrote:
> I don't think I've overlooked anything in Chicken.
Chicken has readline support. You have to install it separately. Try
"chicken-setup readline" at the shell prompt, and then do this:
% csi -quiet[color=darkred]
csi> <you now have readline support>
You could also put the two expressions shown above in your .csirc file,
so you wouldn't have to type them each time.
Even if you couldn't do this, or if you want to use another interpreter
without readline support, Emacs has a scheme mode that has
readline-like commands and other useful features. Put
(set-variable 'scheme-program-name "your/scheme/interpreter")
in your .emacs and type M-x run-scheme.
And if you don't want to use Emacs, and insist on using an interpreter
with a primitive REPL, at the very least you can copy and paste from
your text editor of choice into that REPL. Under no circumstances do
you have to type expressions twice.
| |
|
| Tydr Schnubbis wrote:
> About emacs, I guess I'm just being lazy for using visual studio instead
> (for C/C++). Â_But I guess you think call browsers, class browsers, and
> graphical debuggers are for chickens...
Smalltalkers don't. :>
| |
| Jens Axel Søgaard 2006-01-29, 7:56 am |
| Tydr Schnubbis wrote:
> Tydr Schnubbis wrote:
>
> Ok, it just doesn't show up in advanced mode. But in the other modes,
> 'case' doesn't work. Oh, well.
Which docs? If that information is missing, the docs needs changing.
Searching for "Stepper" in the HelpDesk turns up the doc.txt on
the Stepper. The first paragraph ends in
Currently, the Stepper is available in the "Beginning
Student" and "Intermediate Student" language levels.
--
Jens Axel Søgaard
| |
| Jens Axel Søgaard 2006-01-29, 7:56 am |
| Tydr Schnubbis wrote:
> I'm watching the Abelson/Sussman Scheme lectures, and I just want to try
> out basic stuff while I'm learning. I'm not going to actually use
> scheme for anything useful. No plans yet, anyway.
If you are following SICP here is some advice to get
the programs running in DrScheme:
<http://schemecookbook.org/view/Cookbook/MiscSICP>
--
Jens Axel Søgaard
| |
| Ben Goetter 2006-01-29, 7:00 pm |
| netytan wrote (about Petite Chez):
> You just download the SWL (Tk) extensions though they may well be
> installed by default on Windows.
They are indeed. It's a nice little REPL.
> emacs just doesn't seem to be up to scratch after using it with CL.
One can run Scheme48 under SLIME48, though it takes a little patching
to work on Windows. Might give you a little more of your CL experience.
Ben
| |
| James Graves 2006-01-30, 7:03 pm |
| Ulrich Hobelmann <u.hobelmann@web.de> wrote:
>I use rlwrap for just about anything. No need to recompile anything
>with readline. Just call any program, whether it's GPL, BSD, or
>proprietary.
>
>It even saves one history file for whatever program you call it with.
I had no idea a program like this existed. That is pretty darn handy.
I mostly used Scheme 48, which doesn't have any command history. I had
thought about adding support for it, but that's pretty far down on my
list of priorities. I won't be thinking about it now.
Thanks!
James Graves
| |
| Ray Dillinger 2006-01-30, 7:04 pm |
| Jens Axel Søgaard wrote:
> Repeatedly pressing ctrl+p (for previously) will get you
> the previously entered expressions in the DrScheme interaction
> window. Copying s-expressions is done by placing the cursor
> before the parenthesis pressing alt+rightarrow alt-c and then
> alt-v where you want to insert it.
I'm continually annoyed by schemata that don't have a
command shell that lets me edit and reenter previous
inputs, or which restrict editing to the current line,
not allowing backspace or left-arrow to cross line
boundaries - or which don't allow newline characters
at the command shell, making code into a great gray
block. I sort of understand that they intend to be
run as inferior processes under emacs, but it's still
irritating.
I think the following are pretty good guidelines for an
interactive language, and what I plan to do myself when
my system is advanced so far as to have an interactive
shell. Of course, you'd want an emacs-mode switch that
turns some of these off so as not to confuse emacs, but
that's a reasonable parallel to the interactive-mode
switch I'll be using to tell it not to function as a
compiler-only system.
I leave more complex editing tasks (structure editing,
cut&paste, etc) to editors, the software best suited
for it. But just by itself, I think a lisp shell ought
to do at least this...
up-arrow, down-arrow: moves up or down through edited
input history. The current typed-but-not-entered
input, if any, is saved (including any edits made
so far on it) and the previous/next input in the
history (edited versions) appears in its place.
The window may have to scroll up or down to
accomodate the apparition.
left-arrow, right-arrow: moves edit cursor back and
forth in typed-but-not-entered input including
wrapping at line breaks.
backspace: deletes the character to the immediate left of
the cursor and moves the cursor left. If the cursor
is at the beginning of a line, the newline character
separating lines is deleted, the window above the
cursor scrolls down, the cursor appears at the end
of the line previous, and further characters on the
current line, if any, appear after the last visible
character on the previous line.
Left-paren, right-paren: highlight the matching right/left paren
if any and if it's on the current window.
enter: If the previous character was not a line break, inserts
a line break for code formatting during entry. If the
previous character was a line break and the current
expression is balanced, "enters" the present
expression into the system to be executed. If the
present expression is "entered", it is also appended
to the edited and (optionally) unedited command
histories.
(optional) If the previous character was a line break
and the current expression is unbalanced, highlights
the extra right-parens or inserts the missing right-
parens without "entering" the present expression.
(and may print a message in a separate window area if
I do a full ncurses interface).
(optional)
delete: deletes the character under the cursor and scrolls the
remainder of the line left. If the cursor is at the right
end of the line, the newline character separating
the lines is deleted and the window above the cursor
scrolls down, with the subsequent line appearing to
the right of the cursor.
(optional)
page-up, page-down: moves up or down through the unedited
input history. The current typed-but-not-entered
input, if any, is not saved, and the previous/next
input in the history (unedited version) takes its
place. The window may have to scroll up or down to
accomodate the apparition.
Bear
|
|
|
|
|