Initially the top loop window looks like:

The M> is the ML prompt . The ;;'s are the usual termination characters for ML expressions and declarations. The top loop always supplies these; you never have to type them yourself. The is the cursor . To differentiate it from other kinds of cursors we call it a text cursor . You can type text whenever you have a text cursor. Other kinds of cursors are screen cursors and term cursors . These have redily distinguishable appearances; a screen cursor outlines a single character, and a term cursor highlights a region of the screen.
The basic top loop commands
are summarized in Table
.
Table: Basic Top Loop Commands
For convenience, many of the key bindings for the basic commands have been made similar to those used in emacs . Some of these bindings are context sensitive; specifically the INSERT-CHAR-x, ML-EVALUATE, INSERT-NEWLINE,DELETE-CHAR-RIGHT and DELETE-CHAR-LEFT all rely on there being a text cursor.
Output from evaluation is usually printed out to the shell from which Nuprl has been invoked. For this reason you will want to keep the shell window visible and perhaps immediately above the ML-Top-Loop window.
To evaluate an ML expression, type in the expression at a text cursor, just after the M> prompt, and then use ML-EVALUATE. For example, if you type:
![]()
Nuprl responds by evaluating the expression, and printing to the prl-shell the value of the expression ( 4) and its type ( int):

To correct input you type, use the DELETE-CHAR-BEFORE and DELETE-CHAR-AFTER commands. To move the cursor around, you can use SCREEN-UP,SCREEN-DOWN,SCREEN-LEFT and SCREEN-RIGHT. Alternatively you can use the mouse: To get a text cursor between two given character positions, click MOUSE-LEFT with the mouse pointing at the character position to the right. Using the cursor motion commands you will doubtless encounter the other kinds of cursors. Nuprl uses these other cursors when a text cursor is inappropriate. These cursors don't destructively modify the display. If you get one, continue to use the SCREEN-* commands or MOUSE-LEFT to get back to a text cursor.
To get a continuation line
for a command, key
S- RETURN
. The
continuation prompt
is >. For example, if you entered:
![]()
you would get:

The continuation prompt behaves much like a character, in that you can use the DELETE-CHAR-* commands to delete it.
The ML Top Loop maintains a command history going back to the start of a session. Use the ML-HISTORY-* commands to scroll back and forth through the history.
To exit the ML Top Loop and return to Lisp, use the EXIT-TOP-LOOP command.
Occasionally you can get the ML Top Loop
into an unexpected state. In
this case, you can re-initialize
the ML-Top-Loop
window by deleting
the existing term in the window, and then using the INITIALIZE
command. The keystroke sequence for doing this from any position in
the window is
M-<
CM-K
CM-I
. This will not disrupt
your command history.
Nuprl error messages are both output to the shell and for convenience displayed in highlighted text in the ML-Top-Loop window. These messages don't change the contents of the window in any way, and any keystroke or mouse-click directed at the ML-Top-Loop window causes the error display to go away.
Errors can come from various sources. For example, a message is generated if you type an expression for evaluation into ML Top Loop and the expression doesn't parse or type-check properly. In this event, the most appropriate keystroke is ML-HISTORY-PREV to recall the incorrectly entered expression. Error messages are also created when, during the course of evaluation of an ML expression, an exception is generated and uncaught.
Similar error messages appear in rulebox windows when something goes wrong with the entry or evaluation of a tactic. In this case, harmless keystrokes to use to make the message vanish include the screen motion commands and MOUSE-LEFT .