This chapter reviews what you've learned about the stack and de-
scribes commands for manipulating objects on the stack. Also briefly
described is the use of local variables to simplify stack manipulations.
Review of Stack Concepts
The stack is a sequence of numbered
each holding one object.
The objects you key into the command line are put on the stack when
you execute ENTER. The first object in the command line is the first
object put on the stack. Each object is put in levell, lifting other ob-
jects to the next higher stack level. The stack can grow indefinitely
(within the limits of calculator memory), so you don't need to think
about how many objects are on the stack before entering more
In general, a command removes input objects (called
the stack and replaces them with output objects (called
stack. For example, the function
removes two arguments from levels
1 and 2, replacing them with their sum in level 1.
The arguments must be present on the stack before the command is
executed. This type of logic, where the command comes after the ar-
guments, is called
stack logic, postfix logic,
in honor of the Polish logician Jan Lukasiewicz (1878-1956).
The results of a command are available as arguments for the next
command. If you're not ready to use the results yet, simply leave
them on the stack-they'll be available when you're ready for them.
19: The Stack