9. Submethods

In this chapter we introduce submethods, which makes it possible to organise methods in a hierarchy similar to a class hierarchy using subclasses. As for subclass and superclass, submethod and supermehtod are dual terms. A submethod is a method that has another method as a supermetod, and thus a supermethod is a method being used to define submethods.

One primary use of methods being used as a supermethod is to define new control abstractions which may be used as control structures like if-then, etc. In this chapter, we show examples of simple control abstractions. The chapter 11 Building parallel abstractions has further examples.