15

Just starting into The Little Schemer, and have a very basic Dr. Racket IDE question:

  1. How can I clear the interpreter screen?

  2. How can I set the up arrow to display the previously-typed items (like in Bash) rather than the current behavior of scrolling up the screen?

My searches are coming up blank, possibly because I don't know the technical term for these actions.

Óscar López
  • 232,561
  • 37
  • 312
  • 386
i_made_that
  • 941
  • 1
  • 8
  • 19

2 Answers2

15

Here's how:

  1. Click on the "run" button, as you discovered
  2. Press Esc + p

And this is the relevant page in the documentation.

Óscar López
  • 232,561
  • 37
  • 312
  • 386
4

1 clear interactions window

As you found out, pressing RUN |> starts up a new instance of the selected language, runs everything in the definition window and clears everything you've done in interactions window (repl).

2 get previous entries like in a shell

a) In the Racket IDE you can hold CTRL with arrow keys to get to previously written statements in the interactions window.

b) Racket can be run from terminal too. When in CLI you type racket it starts up the read-eval-print loop with racket loaded and if you enter (require xrepl) as the first statement you have similar to readline capabilities with up-arrow to get previous, CTRL+r to search history and REPL-commands like ,apropos, ,help and so on. It's called eXtended REPL

Community
  • 1
  • 1
Sylwester
  • 47,942
  • 4
  • 47
  • 79
  • CTRL+arrow does not work in Mac - it's already bound by the system. – Elazar Nov 24 '17 at 09:50
  • @elazar On a mac you use cmd instead of ctrl. – Sylwester Nov 24 '17 at 10:59
  • ctrl+cmd+arrow does what you need on a mac, in addition to the esc+P – Ben Dec 31 '18 at 04:51
  • I hadn't tried running it from the terminal, but that is very helpful. (I didn't want to start a new instance; I just wanted to clear the window and put the prompt at the top. The standard readline key combination ^L does that.) – Mars Jun 23 '20 at 16:53