Module Simula

Class RTS_RTObject.ForList

java.lang.Object
simula.runtime.RTS_RTObject.ForList
All Implemented Interfaces:
Iterable<Boolean>
Enclosing class:
RTS_RTObject

public final class RTS_RTObject.ForList extends Object implements Iterable<Boolean>
The Implementation of the for-statement is a bit tricky. The basic idea is to create a ForList iterator that iterates over a set of ForElt iterators. The following subclasses of ForElt are defined: Each of which has a boolean method 'hasNext' indicating whether this for-element is exhausted. All parameters to these classes are transferred 'by name'. This is done to ensure that all expressions are evaluated in the right order. The assignment to the 'control variable' is done within the various for-elements when the 'next' method is invoked.