Methods without Classes in Oberon

Oberon was created by Niklas Wirth, the same person who created Pascal. This langauge does not classes, per se, only records. Typically one creates a record, as well as a type that represents a pointer to this record. (In later chapters we will see why pointers tend to play such an important part in object-oriented languages).

One can then define functions using a special syntax, defining the receiver for a message before the function name, and the remainder of the arguments after the function name. These can be used in a fashion that looks similar to other object oriented languages, although the meaning is slightly different. In reality, they are simply functions defined at the global scope, and not methods at all.

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