]> Cypherpunks repositories - gostls13.git/commitdiff
spec: consistently use "defined type" and "type name" (cleanup)
authorRobert Griesemer <gri@golang.org>
Tue, 23 Jan 2018 00:20:01 +0000 (16:20 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 23 Jan 2018 17:39:18 +0000 (17:39 +0000)
When we introduced the notion of alias type declarations, we renamed
"named type" to "defined type" to avoid confusion with types denoted
by aliases and thus are also types with names, or "named types".

Some of the old uses of "named types" remained; this change removes
them.

Now the spec consistently uses the terms:

- "defined type"  for a type declared via a type definition
- "type name"     for any name denoting an (alias or defined) type
- "alias"         for a type name declared in an alias declaration

New prose is encouraged to avoid the term "named type" to counter-
act further confusion.

Fixes #23474.

Change-Id: I5fb59f1208baf958da79cf51ed3eb1411cd18e03
Reviewed-on: https://go-review.googlesource.com/89115
Reviewed-by: Rob Pike <r@golang.org>
doc/go_spec.html

index 1ada626bf031e0545700cfe9a7afac33eea866a0..33b66cb9053699d614a7ace12538ded53ce7881e 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of January 17, 2018",
+       "Subtitle": "Version of January 23, 2018",
        "Path": "/ref/spec"
 }-->
 
@@ -694,9 +694,8 @@ TypeLit   = ArrayType | StructType | PointerType | FunctionType | InterfaceType
 </pre>
 
 <p>
-Named instances of the boolean, numeric, and string types are
-<a href="#Predeclared_identifiers">predeclared</a>.
-Other named types are introduced with <a href="#Type_declarations">type declarations</a>.
+The language <a href="#Predeclared_identifiers">predeclares</a> certain type names.
+Others are introduced with <a href="#Type_declarations">type declarations</a>.
 <i>Composite types</i>&mdash;array, struct, pointer, function,
 interface, slice, map, and channel types&mdash;may be constructed using
 type literals.
@@ -1025,8 +1024,8 @@ of a struct except that they cannot be used as field names in
 </p>
 
 <p>
-Given a struct type <code>S</code> and a type named <code>T</code>,
-promoted methods are included in the method set of the struct as follows:
+Given a struct type <code>S</code> and a <a href="#Type_definitions">defined type</a>
+<code>T</code>, promoted methods are included in the method set of the struct as follows:
 </p>
 <ul>
        <li>
@@ -2643,8 +2642,8 @@ expression is illegal.
 </li>
 
 <li>
-As an exception, if the type of <code>x</code> is a named pointer type
-and <code>(*x).f</code> is a valid selector expression denoting a field
+As an exception, if the type of <code>x</code> is a <a href="#Type_definitions">defined</a>
+pointer type and <code>(*x).f</code> is a valid selector expression denoting a field
 (but not a method), <code>x.f</code> is shorthand for <code>(*x).f</code>.
 </li>