Next: , Previous: , Up: Top   [Contents][Index]


8 Templates for REDUCE structures

Commands are provided to insert and format the major REDUCE language structures; currently block or compound (begin … end), group (<< … >>) and conditional (if … then … else …) statements are supported. By default they are formatted to be multi-line. If given a prefix argument, the commands to insert block and group statements (composites) format them on a single line (appropriate in some very simple cases).

If there is text on the line after where a composite is inserted then it is moved into the body of the composite; if transient mark mode is on and the mark is active then the whole region is moved into the composite; the composite is then re-indented.

The cursor is left in place to enter the body statements of a group, whereas a block is inserted complete with an empty scalar declaration and the cursor is left in place to enter the names of the scalar variables.

C-c b
M-x reduce-insert-block

Insert and indent a begin scalar ; … end block and position point inside. With an argument put begin and end on the same line.

C-c <
M-x reduce-insert-group

Insert and indent a << … >> group and position point inside. With an argument put << and >> on the same line.

C-c i
M-x reduce-insert-if-then

Insert if … then and position point inside. With argument include a correctly indented else on a second line.

Probably the easiest way to access these templates from the keyboard is not directly as described above but via the generalized completion facilities described in the next chapter. See Keyword completion and abbreviation expansion.


Next: , Previous: , Up: Top   [Contents][Index]