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

Issue 6503116: code review 6503116: spec: clarify section on string types (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by gri
Modified:
12 years, 6 months ago
Reviewers:
CC:
r, rsc, iant, ken2, golang-dev
Visibility:
Public.

Description

spec: clarify section on string types Strings happen to be represented similarly to byte slices internally, but they don't quite behave like them: While strings can be indexed, sliced, and have their len() taken like byte slices, string elements are not addressable, make() and cap() is not supported, range loops operate differently, and they are immutable (and thus behave like values rather then references). Fixes issue 4018.

Patch Set 1 #

Patch Set 2 : diff -r 0b67641b4d2f https://code.google.com/p/go #

Patch Set 3 : diff -r 0b67641b4d2f https://code.google.com/p/go #

Total comments: 6

Patch Set 4 : diff -r 0b67641b4d2f https://code.google.com/p/go #

Patch Set 5 : diff -r 8533ef0a112a https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -15 lines) Patch
M doc/go_spec.html View 1 2 3 5 chunks +17 lines, -15 lines 0 comments Download

Messages

Total messages: 7
gri
Hello r, rsc, iant, ken2 (cc: golang-dev@googlegroups.com), I'd like you to review this change to ...
12 years, 6 months ago (2012-09-13 21:39:10 UTC) #1
iant
https://codereview.appspot.com/6503116/diff/5001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/6503116/diff/5001/doc/go_spec.html#newcode792 doc/go_spec.html:792: the built-in function <a href="#Length_and_capacity"><code>len(s)</code></a>. I know this is ...
12 years, 6 months ago (2012-09-13 23:07:41 UTC) #2
gri
PTAL http://codereview.appspot.com/6503116/diff/5001/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/6503116/diff/5001/doc/go_spec.html#newcode792 doc/go_spec.html:792: the built-in function <a href="#Length_and_capacity"><code>len(s)</code></a>. On 2012/09/13 23:07:41, ...
12 years, 6 months ago (2012-09-14 00:04:04 UTC) #3
r
LGTM
12 years, 6 months ago (2012-09-14 03:48:04 UTC) #4
iant
LGTM
12 years, 6 months ago (2012-09-14 04:53:32 UTC) #5
rsc
LGTM
12 years, 6 months ago (2012-09-14 15:41:10 UTC) #6
gri
12 years, 6 months ago (2012-09-14 18:32:00 UTC) #7
*** Submitted as http://code.google.com/p/go/source/detail?r=8df0b8f89db3 ***

spec: clarify section on string types

Strings happen to be represented similarly to
byte slices internally, but they don't quite
behave like them: While strings can be indexed,
sliced, and have their len() taken like byte
slices, string elements are not addressable,
make() and cap() is not supported, range loops
operate differently, and they are immutable (and
thus behave like values rather then references).

Fixes issue 4018.

R=r, rsc, iant, ken
CC=golang-dev
http://codereview.appspot.com/6503116
Sign in to reply to this message.

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