A simple class definition begins with a statement of the form
:- class ClassName = [SlotDef, …].
The class’s slots are described in the list of SlotDef terms. It is possible, though not often useful, to define a class with no slots, by specifying the empty list. In that case the ‘=’ and the list may be omitted.
The class’s methods are defined following the
by Prolog clauses. Most of this section is about defining and using
The class definition ends with any of the following:
:- end_class ClassName.
or the next
class/1 directive or the end of the file. The
ClassName argument to
end_class/1 must match the class name in the
class/1 directive. It is not possible to nest one class
definition inside another.