Skip to content

Commit 6730c35

Browse files
committed
Add a new proposal: 0006 Apply API Guidelines to the Standard Library
1 parent 4444d23 commit 6730c35

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Apply API Guidelines to the Standard Library
2+
3+
* Proposal: [SE-0006](https://github.com/apple/swift-evolution/proposals/0006-apply-api-guidelines-to-the-standard-library.md)
4+
* Author(s): [Dave Abrahams](https://github.com/dabrahams), [Dmitri Gribenko](https://github.com/gribozavr), [Maxim Moiseev](https://github.com/moiseev)
5+
* Status: **Review**
6+
* Review manager: TBD
7+
8+
## Introduction
9+
10+
The entire Swift standard library is being reviewed and updated to follow the
11+
[Swift API Design Guidelines][api-design-guidelines] being developed as part of
12+
Swift 3.
13+
14+
## Proposed solution
15+
16+
The actual work is being performed on the [swift-3-api-guidelines
17+
branch][swift-stdlib-update] of the [Swift repository][swift-repo].
18+
On high level, the changes can be summarized as follows.
19+
20+
* Strip `Type` suffix from remaining protocol names. In a few special cases
21+
this means adding a `Protocol` suffix to get out of the way of type
22+
names that are primary (though most of these we expect to be
23+
obsoleted by Swift 3 language features).
24+
25+
* The concept of `generator` is renamed to `iterator`.
26+
27+
* `IndexingGenerator` is renamed to `DefaultCollectionIterator`.
28+
29+
## API diffs
30+
31+
Differences between Swift 2.2 Standard library API and the proposed API are
32+
added to this section as they are being implemented on the
33+
[swift-3-api-guidelines branch][swift-stdlib-update].
34+
35+
## Impact on existing code
36+
37+
The proposed changes are massively source-breaking for Swift code, and will
38+
require a migrator to translate Swift 2 code into Swift 3 code. The API diffs
39+
from this proposal will be the primary source of the information about the
40+
required transformations. In addition, to the extent the language allows, the
41+
library will keep old names as unavailable symbols with a `renamed` annotation,
42+
that allows the compiler to produce good error messages and emit Fix-Its.
43+
44+
[api-design-guidelines]: https://swift.org/documentation/api-design-guidelines.html "API Design Guidelines"
45+
[swift-repo]: https://github.com/apple/swift "Swift repository"
46+
[swift-3-api-guidelines-repo]: https://github.com/apple/swift-3-api-guidelines-review "Swift 3 API Design Guidelines review repository"
47+

0 commit comments

Comments
 (0)