A more flexible way of repeating declarations is to use the listener's History menu. This menu is a list of all declarations previously accepted by the listener; the most recent declaration is listed at the top.
When you select a declaration from the list, it appears at the current prompt (at the bottom of the listener window), as originally formatted -- possibly over multiple lines. You may now edit it, before pressing Return, at which point it is evaluated.
Instead of using the menu, you can use the Previous and Next buttons at the bottom of the listener to move up and down the history list. You can control the maximum number of history items in the list for your listener with the Usage > General Preferences > General menu item.
The Clear button clears the current prompt (equivalent to the Ctrl+U keystroke), but not the history list, which it leaves unchanged. The Abandon button functions like Clear, but it stores the contents of the cleared prompt on the history list, from where it may be recovered later.
Finally note that you can use MLWorks' tab-completion to save typing. Pressing the Tab key when part-way through a word causes MLWorks to complete the word as an existing identifier, if this can be done uniquely. For example, consider the following:
MLWorks> val a_long_identifier = "Hello, World."; val a_long_identifier : string = "Hello, World." MLWorks> a_l
At this point on the line, we press the Tab key, and as there is only one identifier beginning 'a_l
', MLWorks completes it:
MLWorks> a_long_identifier
If there is more than one possible completion, MLWorks brings up a completion dialog with a line for each possible completion. You may select one, in which case it is inserted at the prompt in the usual way, or press the Cancel button on the dialog. Either action causes the dialog to disappear. Alternatively, if you simply carry on typing in the listener, the completion dialog will disappear.
If the identifier you start typing is a structure name, tab-completion will complete the structure name, allowing you to start typing the qualified name you need from within the structure. If it is a string, MLWorks will try to complete it as a filename; this is useful when using a function such as use
(see the next section).
If completion dialogs are not to your taste, you can switch them off using the Usage > General Preferences > General menu item on the MLWorks podium.