Class predicate words
Factor handbook » The language » Objects » Classes

Prev:subclass-of? ( class superclass -- ? )

With a handful of exceptions, each class has a membership predicate word, named class?. A quotation calling this predicate is stored in the "predicate" word property.

When it comes to predicates, the exceptional classes are:
f[ not ]The conventional name for a word which outputs true when given false is not; f? would be confusing.
object[ drop t ]All objects are instances of object
null[ drop f ]No object is an instance of null

The set of class predicate words is a class:

predicate? ( object -- ? )

A predicate word holds a reference to the class it is predicating over in the "predicating" word property.

Implementation of class reloading:
reset-class ( class -- )

forget-class ( class -- )

forget-methods ( class -- )