Commit Graph

4 Commits

Author SHA1 Message Date
Dave Abrahams
68b4314d47 [stdlib] Move String.CharacterView's implementation...
...into its own file.

Swift SVN r28077
2015-05-02 04:50:37 +00:00
Dave Abrahams
1198e2aa7a [stdlib] Fix a bug I committed.
Swift SVN r28076
2015-05-02 04:41:43 +00:00
Dave Abrahams
5d1da8d350 [stdlib] Update String doc comments...
...for the addition of CharacterView

Swift SVN r28073
2015-05-02 04:33:12 +00:00
Dave Abrahams
4ce1891cae [stdlib] String is no longer a SequenceType
<rdar://20494686>

String itsef should only expose Unicode-correct algorithms, like proper
substring/prefix/suffix search, enumerating words/lines/paragraphs, case
folding etc. Promoting sequence-centric algorithms to methods on String
is not acceptable since it invites users to write wrong code. Thus,
String has to lose its SequenceType conformance.

Nevertheless, we recognize that sometimes it is useful to manipulate the
String contents on lower levels (UTF-8, UTF-16, Unicode scalars,
extended grapheme clusters), for example, when implementing high-level
Unicode operations, so we can't remove low-level operations
altogether. For this reason, String provides nested "views" for the
first three low-level representations, but grapheme clusters were in a
privileged position -- String itself is a collection of grapheme
clusters. We propose to add a characters view that will represent the
String as a collection of Character values.

Swift SVN r28065
2015-05-02 01:52:02 +00:00