Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(656)

Side by Side Diff: doc/go_spec.html

Issue 71790044: code review 71790044: spec: be more precise about underlying types of predecl... (Closed)
Patch Set: diff -r 82edfcdee1bc https://code.google.com/p/go Created 11 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!--{ 1 <!--{
2 "Title": "The Go Programming Language Specification", 2 "Title": "The Go Programming Language Specification",
3 » "Subtitle": "Version of March 5, 2014", 3 » "Subtitle": "Version of March 6, 2014",
4 "Path": "/ref/spec" 4 "Path": "/ref/spec"
5 }--> 5 }-->
6 6
7 <!-- 7 <!--
8 TODO 8 TODO
9 [ ] need language about function/method calls and parameter passing rules 9 [ ] need language about function/method calls and parameter passing rules
10 [ ] last paragraph of #Assignments (constant promotion) should be elsewhere 10 [ ] last paragraph of #Assignments (constant promotion) should be elsewhere
11 and mention assignment to empty interface. 11 and mention assignment to empty interface.
12 [ ] need to say something about "scope" of selectors? 12 [ ] need to say something about "scope" of selectors?
13 [ ] clarify what a field name is in struct declarations 13 [ ] clarify what a field name is in struct declarations
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 also have a distinct <i>dynamic type</i>, which 667 also have a distinct <i>dynamic type</i>, which
668 is the actual type of the value stored in the variable at run time. 668 is the actual type of the value stored in the variable at run time.
669 The dynamic type may vary during execution but is always 669 The dynamic type may vary during execution but is always
670 <a href="#Assignability">assignable</a> 670 <a href="#Assignability">assignable</a>
671 to the static type of the interface variable. For non-interface 671 to the static type of the interface variable. For non-interface
672 types, the dynamic type is always the static type. 672 types, the dynamic type is always the static type.
673 </p> 673 </p>
674 674
675 <p> 675 <p>
676 Each type <code>T</code> has an <i>underlying type</i>: If <code>T</code> 676 Each type <code>T</code> has an <i>underlying type</i>: If <code>T</code>
677 is a predeclared type or a type literal, the corresponding underlying 677 is one of the predeclared boolean, numeric, or string types, or a type literal,
678 the corresponding underlying
678 type is <code>T</code> itself. Otherwise, <code>T</code>'s underlying type 679 type is <code>T</code> itself. Otherwise, <code>T</code>'s underlying type
679 is the underlying type of the type to which <code>T</code> refers in its 680 is the underlying type of the type to which <code>T</code> refers in its
680 <a href="#Type_declarations">type declaration</a>. 681 <a href="#Type_declarations">type declaration</a>.
681 </p> 682 </p>
682 683
683 <pre> 684 <pre>
684 type T1 string 685 type T1 string
685 type T2 T1 686 type T2 T1
686 type T3 []T1 687 type T3 []T1
687 type T4 T3 688 type T4 T3
(...skipping 5390 matching lines...) Expand 10 before | Expand all | Expand 10 after
6078 </li> 6079 </li>
6079 6080
6080 <li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as 6081 <li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as
6081 <code>unsafe.Alignof(x[0])</code>, but at least 1. 6082 <code>unsafe.Alignof(x[0])</code>, but at least 1.
6082 </li> 6083 </li>
6083 </ol> 6084 </ol>
6084 6085
6085 <p> 6086 <p>
6086 A struct or array type has size zero if it contains no fields (or elements, resp ectively) that have a size greater than zero. Two distinct zero-size variables m ay have the same address in memory. 6087 A struct or array type has size zero if it contains no fields (or elements, resp ectively) that have a size greater than zero. Two distinct zero-size variables m ay have the same address in memory.
6087 </p> 6088 </p>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b