next up previous contents
Next: "->" does not Up: CHAPTER.3: PROCEDURES AND Previous: Exercises on the

More examples of uses of the stack

Put four things on the stack, two integers and two words.

    3, "cat", 99, "blue";
The assignment arrow can be used to remove the top of the stack and store it as the value of x.

    -> x;
Now print out what is left on the stack.

    =>
    ** 3 cat 99
I.e. only three things left. What was the fourth is now the value of x:

    x =>
    ** blue
(The non-destructive assignment arrow "->>" described later, assigns the top of the stack without removing it.)



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