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

Delta Between Two Patch Sets: doc/go_spec.html

Issue 6448137: code review 6448137: go_spec.html: clarify rune and string literals (Closed)
Left Patch Set: diff -r 8f0c8f604ee0 https://code.google.com/p/go Created 11 years, 7 months ago
Right Patch Set: diff -r 008d345d81e0 https://code.google.com/p/go Created 11 years, 7 months 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 <!--{ 1 <!--{
2 "Title": "The Go Programming Language Specification", 2 "Title": "The Go Programming Language Specification",
3 » "Subtitle": "Version of August 18, 2012", 3 » "Subtitle": "Version of August 29, 2012",
gri 2012/08/29 21:33:57 up-date before submitting
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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 'ä' 434 'ä'
435 '本' 435 '本'
436 '\t' 436 '\t'
437 '\000' 437 '\000'
438 '\007' 438 '\007'
439 '\377' 439 '\377'
440 '\x07' 440 '\x07'
441 '\xff' 441 '\xff'
442 '\u12e4' 442 '\u12e4'
443 '\U00101234' 443 '\U00101234'
444 'aa' // Illegal: too many characters 444 'aa' // illegal: too many characters
gri 2012/08/29 21:33:57 elsewhere we start text in comments w/ lower-case
445 '\xa' // Illegal: too few hexadecimal digits 445 '\xa' // illegal: too few hexadecimal digits
446 '\0' // Illegal: too few octal digits 446 '\0' // illegal: too few octal digits
447 '\uDFFF' // Illegal: surrogate half 447 '\uDFFF' // illegal: surrogate half
448 '\U00110000' // Illegal: invalid Unicode code point 448 '\U00110000' // illegal: invalid Unicode code point
449 </pre> 449 </pre>
450 450
451 451
452 <h3 id="String_literals">String literals</h3> 452 <h3 id="String_literals">String literals</h3>
453 453
454 <p> 454 <p>
455 A string literal represents a <a href="#Constants">string constant</a> 455 A string literal represents a <a href="#Constants">string constant</a>
456 obtained from concatenating a sequence of characters. There are two forms: 456 obtained from concatenating a sequence of characters. There are two forms:
457 raw string literals and interpreted string literals. 457 raw string literals and interpreted string literals.
458 </p> 458 </p>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 <pre> 494 <pre>
495 `abc` // same as "abc" 495 `abc` // same as "abc"
496 `\n 496 `\n
497 \n` // same as "\\n\n\\n" 497 \n` // same as "\\n\n\\n"
498 "\n" 498 "\n"
499 "" 499 ""
500 "Hello, world!\n" 500 "Hello, world!\n"
501 "日本語" 501 "日本語"
502 "\u65e5本\U00008a9e" 502 "\u65e5本\U00008a9e"
503 "\xff\u00FF" 503 "\xff\u00FF"
504 "\uD800" // Illegal: surrogate half 504 "\uD800" // illegal: surrogate half
gri 2012/08/29 21:33:58 // illegal: ...
505 "\U00110000" // Illegal: invalid Unicode code point 505 "\U00110000" // illegal: invalid Unicode code point
506 </pre> 506 </pre>
507 507
508 <p> 508 <p>
509 These examples all represent the same string: 509 These examples all represent the same string:
510 </p> 510 </p>
511 511
512 <pre> 512 <pre>
513 "日本語" // UTF-8 input text 513 "日本語" // UTF-8 input text
514 `日本語` // UTF-8 input text as a raw literal 514 `日本語` // UTF-8 input text as a raw literal
515 "\u65e5\u672c\u8a9e" // The explicit Unicode code points 515 "\u65e5\u672c\u8a9e" // the explicit Unicode code points
gri 2012/08/29 21:33:58 probably // the explicit ...
516 "\U000065e5\U0000672c\U00008a9e" // The explicit Unicode code points 516 "\U000065e5\U0000672c\U00008a9e" // the explicit Unicode code points
517 "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" // The explicit UTF-8 bytes 517 "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" // the explicit UTF-8 bytes
518 </pre> 518 </pre>
519 519
520 <p> 520 <p>
521 If the source code represents a character as two code points, such as 521 If the source code represents a character as two code points, such as
522 a combining form involving an accent and a letter, the result will be 522 a combining form involving an accent and a letter, the result will be
523 an error if placed in a rune literal (it is not a single code 523 an error if placed in a rune literal (it is not a single code
524 point), and will appear as two code points if placed in a string 524 point), and will appear as two code points if placed in a string
525 literal. 525 literal.
526 </p> 526 </p>
527 527
(...skipping 5012 matching lines...) Expand 10 before | Expand all | Expand 10 after
5540 </li> 5540 </li>
5541 5541
5542 <li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as 5542 <li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as
5543 <code>unsafe.Alignof(x[0])</code>, but at least 1. 5543 <code>unsafe.Alignof(x[0])</code>, but at least 1.
5544 </li> 5544 </li>
5545 </ol> 5545 </ol>
5546 5546
5547 <p> 5547 <p>
5548 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. 5548 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.
5549 </p> 5549 </p>
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

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