Introduction to OOP: Chapter 14 : Polymorphism [next] [previous] [audio] [real] [text]

Smalltalk Example

The following occurs in class Magnitude. Recall earlier discussion of relationals to see variety of uses.

between: low and: high
	" test to see if the receiver is between two endpoints "
	^ (low <= self) and: [ self <= high ]
Intro OOP, Chapter 14, Slide 20