eintr: Looping exercise
11.4 Looping Exercise
=====================
• Write a function similar to ‘triangle’ in which each row has a
value which is the square of the row number. Use a ‘while’ loop.
• Write a function similar to ‘triangle’ that multiplies instead of
adds the values.
• Rewrite these two functions recursively. Rewrite these functions
using ‘cond’.
• Write a function for Texinfo mode that creates an index entry at
the beginning of a paragraph for every ‘@dfn’ within the paragraph.
(In a Texinfo file, ‘@dfn’ marks a definition. This book is
written in Texinfo.)
Many of the functions you will need are described in two of the
previous chapters, Cutting and Storing Text Cutting &
Storing Text, and Yanking Text Back Yanking. If you use
‘forward-paragraph’ to put the index entry at the beginning of the
paragraph, you will have to use ‘C-h f’ (‘describe-function’) to
find out how to make the command go backwards.
For more information, see Indicating Definitions
(texinfo)Indicating.