code review 11055043: spec: define notion of named type (issue 11055043)

36 views
Skip to first unread message

g...@golang.org

unread,
Jul 9, 2013, 4:33:52 PM7/9/13
to r...@golang.org, r...@golang.org, ia...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
Reviewers: r, rsc, iant,

Message:
Hello r...@golang.org, r...@golang.org, ia...@golang.org (cc:
golan...@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go


Description:
spec: define notion of named type

The notion of a named type is crucial for the definition
of type identity, assignability, definitions of methods.
Explicitly introduce the notion with an extra sentence.

Fixes issue 5682.

Please review this at https://codereview.appspot.com/11055043/

Affected files:
M doc/go_spec.html


Index: doc/go_spec.html
===================================================================
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of June 21, 2013",
+ "Subtitle": "Version of July 9, 2013",
"Path": "/ref/spec"
}-->

@@ -640,10 +640,10 @@

<p>
A type determines the set of values and operations specific to values of
that
-type. A type may be specified by a
-(possibly <a href="#Qualified_identifiers">qualified</a>)
-<a href="#Type_declarations"><i>type name</i></a> or a <i>type literal</i>,
-which composes a new type from previously declared types.
+type. Types may be <i>named</i> or <i>unnamed</i>. Named types are
specified
+by a (possibly <a href="#Qualified_identifiers">qualified</a>)
+<a href="#Type_declarations"><i>type name</i></a>; unnamed types are
specified
+using a <i>type literal</i>, which composes a new type from existing types.
</p>

<pre class="ebnf">
@@ -1358,9 +1358,9 @@
</p>

<p>
-Two named types are identical if their type names originate in the same
+Two <a href="#Types">named types</a> are identical if their type names
originate in the same
<a href="#Type_declarations">TypeSpec</a>.
-A named and an unnamed type are always different. Two unnamed types are
identical
+A named and an <a href="#Types">unnamed type</a> are always different. Two
unnamed types are identical
if the corresponding type literals are identical, that is, if they have
the same
literal structure and corresponding components have identical types. In
detail:
</p>
@@ -1442,7 +1442,7 @@
<li>
<code>x</code>'s type <code>V</code> and <code>T</code> have identical
<a href="#Types">underlying types</a> and at least one of <code>V</code>
-or <code>T</code> is not a named type.
+or <code>T</code> is not a <a href="#Types">named type</a>.
</li>
<li>
<code>T</code> is an interface type and


r...@golang.org

unread,
Jul 9, 2013, 11:04:32 PM7/9/13
to g...@golang.org, r...@golang.org, ia...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com

g...@golang.org

unread,
Jul 10, 2013, 12:12:56 AM7/10/13
to g...@golang.org, r...@golang.org, r...@golang.org, ia...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
*** Submitted as
https://code.google.com/p/go/source/detail?r=d0c957701447 ***

spec: define notion of named type

The notion of a named type is crucial for the definition
of type identity, assignability, definitions of methods.
Explicitly introduce the notion with an extra sentence.

Fixes issue 5682.

R=r, rsc, iant
CC=golang-dev
https://codereview.appspot.com/11055043


https://codereview.appspot.com/11055043/
Reply all
Reply to author
Forward
0 new messages