Data types: slot

Represents a reference to a slot method.

Type syntax

slot

Literal syntax

null

Discussion

An operand of this data type is intended to store a reference to a slot method of an object. The slots and signals provide a simple mechanism for communication between the objects. Sending a signal to a slot causes the corresponding slot method to be executed.

The slot literal can be null only to explicitly identify 'no slot'. The literal can be used within expressions wherever slot operand is expected. The type name slot, in turn, is designated to be used in declarations of data members. For example:

var slot theSlot = null;  // 'theSlot' doesn't refer to any slot method

theSlot = SomeSlotMethod; // now 'theSlot' refers to 'SomeSlotMethod' of
                          // 'this' object.

Signal operations

You can use a slot operand to send signals to the referenced slot method. Sending a signal causes the method to be executed. Chora provides following statement to send signals:

Statement

Short description

signal

Send a signal to a slot.

postsignal

Post a signal to a slot.

idlesignal

Post a signal to a slot.

notifyobservers

Notify registered observers.

Comparison operations

You can compare two slot operands in order to test whether these refer to the same slot or not. The following table provides an overview of the possible operations:

Operator

Short description

==

Equality test for two slot operands.

!=

Inequality test for two slot operands.