Navigation  without Java Scripts

PREDICATES Section in the Class Declaration

The predicates sections in the class declaration declare predicates (and predicate values) - members of the class.

Syntax

[PROTECTED] [STATIC] PREDICATES <predicates_declarations>
where:
PREDICATES declares the predicates section
PROTECTED changes the access rights of predicates declared in the section from public (default) to protected
STATIC determines that predicates declared in the section are static.
<predicates_declarations> a list of declarations of predicates.

Remarks

The default access rights of the predicates declared in the class declaration are public.

"Ordinary" predicate domains (declared inside or outside a class) can be used in classes only for declarations of static predicate values.

Object (non-static) predicate values can be declared as instances of object predicate domains. If an object predicate value is passed as an argument, then the corresponding object identifier is also passed (as a hidden attribute of this object predicate value) to make this predicate usable.

All predicates declared in the class declaration are virtual predicates, except for new and delete predicates.

The order of STATIC and PROTECTED keywords in the predicates section declaration is insignificant.

Several predicates sections can be declared in a class declaration.

Attention! If a class member predicate declaration does not contain a flow pattern specification, the default flow pattern with all input parameters is accepted. For example (i,i,i).

This is a common reason of getting 703 error while conversions of old well tested Prolog sources to VIP classes.

Example

class xclass
domains
pred_domain = object procedure (integer) - (o)
predicates
writeString
xclass_method : pred_domain
static predicates
classstatistic()
endclass xclass