This video is the final part of the series on Eiffel’s void safety mechanism. It introduces the remaining parts of the mechanism: “CAPS” (Certified Attachment Patterns) and array initialization. A CAP is a program scheme that is known to be safe, for example applying x.f immediately after a test “if x /= Void”, or a standard loop to iterate over a data structure, using “x = Void” as the exit condition. The compiler recognizes such schemes and validates them. Array initialization ensures that you can treat elements of an array as attached.
These simple properties complete the void safety, which removes once and for all the risk of null pointer dereferencing.
The previous parts of the series can be found here:
• • Void Safety in Eiffel, Part 1: the end of ... (part 1)
• • Void Safety in Eiffel, Part 2: the Object ... (part 2)
• • Void Safety in Eiffel, Part 3: the Type Rules (part 3)