Invocation



next up previous contents index
Next: Form of Invocation Up: No Title Previous: Assignment

Invocation

There are two kinds of routines in Theta. A procedure produces a group of one or more objects when it returns. An iterator produces a sequence of items (where an item is a group of one or more objects) one item at a time; it is invoked (only) in a for statement (8.8) and the body of the for statement is executed for each item in the sequence.

Invocation of a routine causes the routine to be executed on the argument objects. This section discusses the part of the invocation mechanism that is common to calls of procedures and iterators (and also makers (10.5.2)).

Stand-alone routines are defined by specifications (9.1); such a specification may be parameterized, in which case it can be instantiated to obtain a routine. Routines are also obtained by evaluating expressions. For example, a routine can be obtained by selecting a method from an object (7.7) or by binding a routine to some actual arguments (7.9).





theta-questions@lcs.mit.edu