Note that before you are able to answer this question you will need to have a good understanding of how interfaces work in Java and the meaning of "final".
queue isEmpty ifTrue:[index<- 0]
[index <= limit] whileTrue: [index <- index + 1]
Why is it that the receiver of the ifTrue: message is a Boolean object (i.e., the result of "queue isEmpty") whereas the receiver for the whileTrue: is a block? Explain the impliciations of this difference.
TYPE T <: U
It says that Type T is a subtype of U. However, it does not say which subtype. A programmer may use this type, just like any other type:
VAR x: T := NEW (T);
The information hiding comes from the fact that the above code can only use x as a U object. In particular, we can invoke methods and access instance variables that are known to be in U, but not any new methods/instance variables that T adds. Thus, the additions of T are hidden. Generally, Modula-3 programs put the opaque type declarations in interfaces (which are similar to header files in C++ and C).
Now, somewhere, the program must reveal what T really is (as opposed to just being some subtype of U). This is done using a REVEAL declaration that takes one of two forms:
REVEAL T = some type that is a subtype of U, or
REVEAL T <: some type that is a subtype of U
The first form says exactly what type T is. Of course, in order to be consistent with T's original opaque declaration, that type must be a subtype of U. This kind of a revelation is called a concrete revelation since it fully reveals the type of T. Concrete revelations are usually put in Modules (equivalent of .c or .cpp files in C or C++) and not in Interfaces. The reason for this is that the contents of Interfaces are visible to other Interfaces and Modules whereas the contents of a Module are not visible outside the Module.
The second form reveals some additional information about T but not the full information. Thus, it is called a partial revelation. For example, it may reveal that T has one additional method (besides the methods inherited from U). Any code that has access to this partial revelation knows about the additional method in T besides the methods inherited from U. In other words, this mechanism allows a programmer to reveal information about a type in multiple stages (perhaps some revelations are meant for "friends" while others for the "general public").
In this question you will get experience understanding and evaluating Modula-3's opaque types. Note that you may refer to the Modula-3 language definition (available from the class web page) to answer these questions.