9.7 Classes

The module Class contains procedures operating on classes.

IsClass

{Class.is +X ?B}

tests whether X is a class.

new

{Class.new +ParentKs +AttrR +FeatR +PropAs ?K}

creates a new class by inheriting from ParentKs with new attributes AttrR and new features FeatR. The fields with integer features in AttrR define the free attributes. The fields with literal features define attributes with initial values, where the feature is the attribute name and the field its initial value. The semantics for FeatR is accordingly. The properties of the class to be created are defined by PropAs (a list of atoms, valid elements are sited, final, and locking).

For example, the statement

C={Class.new [D E] a(a:1 b) f(f:2 g) [final]}

is equivalent to

class C from D E
   prop final
   attr a:1 b
   feat f:2 g
end


Denys Duchier, Leif Kornstaedt and Christian Schulte
Version 1.0.1 (19990218)