12.7 Inputting code fragments to REDUCE

When developing REDUCE code, it may be convenient to be able to test fragments by inputting them into REDUCE. The following commands are intended to be used in a REDUCE mode buffer to send code to a REDUCE process buffer. They all use switch-to-reduce to decide where to send the code. With a prefix argument, the commands also explicitly switch to the REDUCE process window.

The following key bindings are added to REDUCE mode:

C-x C-e
M-x reduce-eval-last-statement

This command sends the code between the beginning of the statement before point and point to REDUCE. The assumption is that point is at the end of a REDUCE statement, but this is not checked so it is possible to send an incomplete statement. (This key binding follows the Emacs convention and is available in both REDUCE Edit and Run modes.)

C-x C-M-e
M-x reduce-eval-line

This command sends the current line of code to REDUCE. A prefix argument means also switch to the REDUCE window. (This key binding is available in both REDUCE Edit and Run modes.)

C-M-x
C-c C-e
M-x reduce-eval-proc

This command sends the procedure definition ending after point to REDUCE. (The C-M-x key binding follows the Emacs convention.)

C-c C-r
M-x reduce-eval-region

This command sends the code in the selected region to REDUCE.