next up previous contents
Next: Introduction to printing Up: CHAPTER.2: INTRODUCTION TO Previous: Procedures which produce

Exercises

1. Define a procedure with one input variable and three output locals, that takes a three element list of numbers as input and produces as output the squares of those three numbers (using "x * x" to get the square of x).

2. Try changing the definition of join_two to use initialised declarations for two of its variables, so that it becomes more compact, using the format:

    lvars
        out1 = .... ,
        out2 = .... ,
It will have only four declarations and no additional instructions, but it will still work.



Aaron Sloman
Fri Jan 2 03:17:44 GMT 1998