Binding in Object Pascal

We end by considering how each of the languages we discuss in this book deals with the various issues raised in this chapter.

We start with Object Pascal. This is a statically typed language. All variables must be declared. Nevertheless, variables are polymorphic, a variable declared as a class type can in fact be holding a value from a subclass. Values retain knowledge of their actual type.

The legality of a message passing expression is checked at compile time, based on the static type of the receiver.

Testing for reverse polymorphism is performed using a function named member. And finally, assignment of reverse polymorphic values can be performed using a cast.

[audio] [real] Text to accompany slide14, in Chapter 10 of An Introduction to Object-Oriented Programming