That's right; that's in the private part of the package. This is important to note - even when something is implemented using access types, that doesn't mean that everyone needs to see how stacks are implemented. In this example, customers can push and pop values on a stack without knowing how access values work.

Note that this version of Generic_Stack is composable. Since this version supports assignment (:=) and equality (=), we can create stacks of stacks. Even if you never create a stack of stacks, checking to see if a reusable component is composable is a good way to check on the generality of a resuable component [Wheeler 1992].

You may go to the next section.

You may also:

PREVIOUS Go back to the question

OUTLINE  Go up to the outline of lesson 12

David A. Wheeler (dwheeler@dwheeler.com)

The master copy of this file is at "http://www.adahome.com/Tutorials/Lovelace/s12sfr2.htm".