VocabularysyntaxSyntaxPREDICATE: class < superclass predicate... ;
InputsNone
OutputsNone
Word descriptionDefines a predicate class deriving from
superclass.
An object is an instance of a predicate class if two conditions hold:
• | it is an instance of the predicate's superclass, |
• | it satisfies the predicate |
Each predicate must be defined as a subclass of some other class. This ensures that predicates inheriting from disjoint classes do not need to be exhaustively tested during method dispatch.
ExamplesUSING: math ;
PREDICATE: positive < integer 0 > ;
See alsopredicate-class,
define-predicate-classDefinition