Home Segments Index Top Previous Next

132: Mainline

A predicate is a method that answers with either of two special objects, true or false. Smalltalk offers several binary predicates that test the relationship between pairs of numbers:

Predicate Purpose\
= Are the receiver and the argument equal?\ ~= Are the receiver and the argument not equal?\ > Is the receiver greater than the argument?\ < Is the receiver less than the argument?\ >= Is the receiver greater than or equal to the argument?\ <= Is the receiver less than or equal to the argument?\