channels.
</p>
-<p>
-TODO: not sure the rest of this section this is needed; it's all covered or should be covered in the sections
-that follow.
-</p>
<p>
At any point in the source code, a type may be <i>complete</i> or
-<i>incomplete</i>. Most types are always complete, although their
-components, such as the base type of a pointer type, may be incomplete.
-Struct and interface types are incomplete when forward declared
-(§Forward declarations) and become complete once they are fully
-declared. (TODO: You had array here - why?)
-The type of a variable must be complete where the variable is declared.
-(TODO: would be better to say what you CAN do with an interface type,
-and then drop all the references to complete types in the sections
-that follow. What can you do? Use one to declare a pointer variable/field/param.
-Anything else?)
+<i>incomplete</i>. An incomplete type is one whose size is not
+yet known, such as a struct whose fields are not yet fully
+defined or a forward declared type (§Forward declarations).
+Most types are always complete; for instance, a pointer
+type is always complete even if it points to an incomplete type
+because the size of the pointer itself is always known.
</p>
<p>
The <i>interface</i> of a type is the set of methods bound to it
</p>
<p>
-String literals separated only by the empty string, white
-space, or comments are concatenated into a single string literal.
+A sequence of string literals is concatenated into a single string.
</p>
<pre class="grammar">
-StringLit = string_lit { string_lit } .
+StringLit = string_lit { string_lit } .
</pre>
<h3>Array types</h3>
</p>
<pre class="grammar">
-ArrayType = "[" ArrayLength "]" ElementType .
+ArrayType = "[" ArrayLength "]" ElementType .
ArrayLength = Expression .
ElementType = CompleteType .
</pre>
<pre>
// A struct corresponding to the EventIdMessage protocol buffer.
-// The tag strings contain the protocol buffer field numbers.
+// The tag strings define the protocol buffer field numbers.
struct {
time_usec uint64 "field 1";
server_ip uint32 "field 2";
</pre>
<p>
-To permit construction of recursive and mutually recursive types,
-the pointer base type may be denoted by the type name of a
-forward-declared, incomplete type (§Forward declarations).
+The pointer base type may be an incomplete type (§Types).
</p>
<h3>Function types</h3>
they implement the Lock interface as well as the File interface.
<p>
An interface may contain a type name T in place of a method specification.
-T must denote another, complete (and not forward-declared) interface type.
+T must denote another, complete interface type.
Using this notation is equivalent to enumerating the methods of T explicitly
in the interface containing T.
A channel provides a mechanism for two concurrently executing functions
to synchronize execution and exchange values of a specified type. This
-type must be a complete type (§Types). <font color=red>(TODO could it be incomplete?)</font>
+type must be a complete type (§Types).
<pre class="grammar">
ChannelType = Channel | SendChannel | RecvChannel .
It may make sense to have a special section in this doc containing these rule
sets for:
-complete/incomplete types
equality of types
identity of types
comparisons
<p>
A variable declaration creates a variable, binds an identifier to it and
gives it a type and optionally an initial value.
-The variable type must be a complete type (§Types).
+The type must be complete (§Types).
</p>
<pre class="grammar">
VarDecl = "var" ( VarSpec | "(" [ VarSpecList ] ")" ) .
</p>
<p>
The function <code>Sizeof</code> takes an expression denoting a
-variable of any type and returns the size of the variable in bytes.
+variable of any (complete) type and returns the size of the variable in bytes.
</p>
<p>
The function <code>Offsetof</code> takes a selector (§Selectors) denoting a struct