Skip to content

Commit e110e20

Browse files
committed
Track 'main' to resolve merge conflict.
Trivial conflict in Style.md by keeping both additions.
2 parents a6426d4 + 4a296e8 commit e110e20

File tree

101 files changed

+27057
-5309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+27057
-5309
lines changed

.git-blame-ignore-revs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is a list of commits that made uninteresting formatting
2+
# changes, which should be ignored by git-blame, so that it can instead
3+
# display more the relevant history and attribution information.
4+
#
5+
# To use this file for a single blame operation,
6+
#
7+
# git blame --ignore-revs-file .git-blame-ignore-revs <somefile>
8+
#
9+
# To use this file for all blame operations, run the following command:
10+
#
11+
# git config --local blame.ignoreRevsFile .git-blame-ignore-revs
12+
#
13+
# For more information, see the git-blame(1) man page's discussion of
14+
# the --ignore-revs-file option, and the git-config(1) man page's
15+
# discussion of the blame.ignoreRevsFile option.
16+
17+
# Convert RST to markdown.
18+
96f0925407c6bd9eadd9d58d253bad3e1ef7a9f2
19+
20+
# Convert the formal grammar to markdown.
21+
4039ee0ef4e69d2cf6460861f9444a499503db16

.git-order-file

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This file lists the chapters of TSPL, in the order they appear in the
2+
# book. When reviewing changes, the diff can be easier to read when it
3+
# appears in this order.
4+
#
5+
# To use this file for single command, run a command like the following:
6+
#
7+
# git log -O .git-order-file
8+
# git diff -O .git-order-file
9+
#
10+
# To use it for all diffs, run the following command:
11+
#
12+
# git config --local diff.orderFile .git-order-file
13+
#
14+
# For more information, see the git-log(1) and git-diff(1) man pages'
15+
# discussions of the -O option, and the git-config(1) man page's
16+
# discussion of diff.orderFile option.
17+
18+
TSPL.docc/GuidedTour/AboutSwift.md
19+
TSPL.docc/GuidedTour/Compatibility.md
20+
TSPL.docc/GuidedTour/GuidedTour.md
21+
22+
TSPL.docc/LanguageGuide/TheBasics.md
23+
TSPL.docc/LanguageGuide/BasicOperators.md
24+
TSPL.docc/LanguageGuide/StringsAndCharacters.md
25+
TSPL.docc/LanguageGuide/CollectionTypes.md
26+
TSPL.docc/LanguageGuide/ControlFlow.md
27+
TSPL.docc/LanguageGuide/Functions.md
28+
TSPL.docc/LanguageGuide/Closures.md
29+
TSPL.docc/LanguageGuide/Enumerations.md
30+
TSPL.docc/LanguageGuide/ClassesAndStructures.md
31+
TSPL.docc/LanguageGuide/Properties.md
32+
TSPL.docc/LanguageGuide/Methods.md
33+
TSPL.docc/LanguageGuide/Subscripts.md
34+
TSPL.docc/LanguageGuide/Inheritance.md
35+
TSPL.docc/LanguageGuide/Initialization.md
36+
TSPL.docc/LanguageGuide/Deinitialization.md
37+
TSPL.docc/LanguageGuide/OptionalChaining.md
38+
TSPL.docc/LanguageGuide/ErrorHandling.md
39+
TSPL.docc/LanguageGuide/Concurrency.md
40+
TSPL.docc/LanguageGuide/Macros.md
41+
TSPL.docc/LanguageGuide/TypeCasting.md
42+
TSPL.docc/LanguageGuide/NestedTypes.md
43+
TSPL.docc/LanguageGuide/Extensions.md
44+
TSPL.docc/LanguageGuide/Protocols.md
45+
TSPL.docc/LanguageGuide/Generics.md
46+
TSPL.docc/LanguageGuide/OpaqueTypes.md
47+
TSPL.docc/LanguageGuide/AutomaticReferenceCounting.md
48+
TSPL.docc/LanguageGuide/MemorySafety.md
49+
TSPL.docc/LanguageGuide/AccessControl.md
50+
TSPL.docc/LanguageGuide/AdvancedOperators.md
51+
52+
TSPL.docc/ReferenceManual/AboutTheLanguageReference.md
53+
TSPL.docc/ReferenceManual/LexicalStructure.md
54+
TSPL.docc/ReferenceManual/Types.md
55+
TSPL.docc/ReferenceManual/Expressions.md
56+
TSPL.docc/ReferenceManual/Statements.md
57+
TSPL.docc/ReferenceManual/Declarations.md
58+
TSPL.docc/ReferenceManual/Attributes.md
59+
TSPL.docc/ReferenceManual/Patterns.md
60+
TSPL.docc/ReferenceManual/GenericParametersAndArguments.md
61+
TSPL.docc/ReferenceManual/SummaryOfTheGrammar.md
62+
63+
TSPL.docc/RevisionHistory/RevisionHistory.md
64+
65+
# Files that don't match a pattern listed above appear at the end.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,4 @@
22
Replace this paragraph with your rationale and a brief summary of what changed.
33

44
<!-- If this pull request fixes a bug tracked in GitHub issues, provide the link. -->
5-
Fixes https://github.com/apple/swift-book/issues/####
6-
7-
8-
<!--
9-
Before merging this pull request, you must run the continuous integration (CI) tests.
10-
When you're ready to start a CI build,
11-
write the following in a comment on the pull request:
12-
13-
@swift-ci Please test.
14-
15-
For more information about triggering CI builds via @swift-ci, see:
16-
17-
https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci
18-
19-
Thank you for your contribution!
20-
-->
5+
Fixes: https://github.com/apple/swift-book/issues/####

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# The Swift Programming Language
22

3-
This repository contains a version of *The Swift Programming Language*
4-
that you can build using Swift-DocC.
5-
6-
The version of *The Swift Programming Language* published on [docs.swift.org](https://docs.swift.org/swift-book/)
7-
is currently built using a legacy toolchain,
8-
not from this repository or its content.
9-
The goal is to replace that version with a version built from this repository,
10-
working with the community to extend Swift-DocC where needed.
3+
This repository contains the source for *The Swift Programming Language*
4+
(sometimes abbreviated as TSPL),
5+
which is published on [docs.swift.org][published]
6+
and built using [Swift-DocC][docc].
117

128
## Contributing
139

@@ -34,8 +30,10 @@ For more information, see [Contributing to The Swift Programming Language][contr
3430
[bugs]: https://github.com/apple/swift-book/issues
3531
[conduct]: https://www.swift.org/code-of-conduct
3632
[contributing]: /CONTRIBUTING.md
37-
[forum]: https://forums.swift.org/c/development/swift-docc/80
33+
[forum]: https://forums.swift.org/c/swift-documentation/92
3834
[tspl-style]: /Style.md
35+
[published]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/
36+
[docc]: https://github.com/apple/swift-docc
3937

4038
## Building
4139

@@ -44,3 +42,15 @@ in this repository's root directory.
4442

4543
After running DocC, open the link that `docc` outputs
4644
to display a local preview in your browser.
45+
46+
> Note:
47+
>
48+
> If you installed DocC by downloading a toolchain from Swift.org,
49+
> `docc` is located in `usr/bin/`,
50+
> relative to the installation path of the toolchain.
51+
> Make sure your shell's `PATH` environment variable
52+
> includes that directory.
53+
>
54+
> If you installed DocC by downloading Xcode,
55+
> run `xcrun docc preview TSPL.docc` instead.
56+

Style.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ just surface level syntax for concepts they already know from other languages.
2626
commonly referred to as “the guide”,
2727
leads you through the Swift language in a pedagogically useful, linear order.
2828
It doesn't promise to show you every feature of
29-
the language or the standard library,
29+
the language or the Swift standard library,
3030
and it hand-waves over the exact details
3131
of some of the more complicated underlying bits.
3232
The guide leans on the reference to resolve the nitty-gritty detail questions
@@ -44,12 +44,12 @@ are already discussed in previous chapters.
4444
that the early chapters of the guide need
4545
— many topics from “The Basics” are covered again later in the guide in more detail.
4646

47-
The guide includes types from the standard library for two reasons:
47+
The guide includes types from the Swift standard library for two reasons:
4848
they’re needed by an explanation of a language concept,
4949
or they’re so common that readers wouldn’t
5050
be able to build anything useful without them.
5151
The latter reason includes a judgement call.
52-
When new types are introduced in the standard library,
52+
When new types are introduced in the Swift standard library,
5353
we usually need to discuss whether & where to add them to TSPL.
5454

5555
The guide can be broken down into three major chunks:
@@ -98,6 +98,11 @@ which means it’s not always suitable for generating a parser for Swift code.
9898

9999
# Terms and Rules
100100

101+
## attribute names
102+
103+
In the guide, write `@` before attribute names;
104+
in the reference, omit it.
105+
101106
## back deploy
102107

103108
Spelled as two words, not closed up or hyphenated.
@@ -121,6 +126,11 @@ Use wording and markup like the following:
121126
> using this attribute will be an error.
122127
```
123128

129+
## definite initialization
130+
131+
Not “definitive initialization”.
132+
Don‘t abbreviate as DI.
133+
124134
## function
125135

126136
In the reference,
@@ -137,6 +147,13 @@ you should generally try to avoid them.
137147
Deeply nested headings often indicate
138148
that there’s a better way to organize the content.
139149

150+
## macro names
151+
152+
In the guide,
153+
write `@` before the name when referring to attached macros
154+
and `#` before the name when referring to freestanding macros.
155+
In the reference, omit it.
156+
140157
## memberwise initializer
141158

142159
Not hyphenated as “member-wise”.
@@ -167,13 +184,17 @@ For example:
167184
> custom classes and structures don’t have an implementation of
168185
> the *equal to* operator (`==`) or *not equal to* operator (`!=`).
169186
> You usually implement the `==` operator,
170-
> and use the standard library’s default implementation of the `!=` operator
187+
> and use the Swift standard library’s default implementation of the `!=` operator
171188
> that negates the result of the `==` operator.
172189
> There are two ways to implement the `==` operator.
173190
174191
If the operator doesn’t have an established English name,
175192
make sure you get tech review on the name you invent for it.
176193

194+
## optional binding
195+
196+
Omit the article: "use optional binding", not "use an optional binding".
197+
177198
## passive voice
178199

179200
In general,
@@ -241,11 +262,22 @@ By design, actors specifically *avoid* having shared mutable state —
241262
their mutable state is private,
242263
and accessible only through the actor's (async) methods.
243264

265+
## standard library
266+
267+
Spell out in full as “the Swift standard library“ on the first use.
268+
If context already makes it clear
269+
and repeating the full name becomes wordy,
270+
you can shorted it to just “the standard library”
271+
in continued discussion.
272+
(We currently don‘t have any examples of doing that.)
273+
274+
Not “stdlib“ or “the stdlib“.
275+
244276
## spawn, start
245277

246278
Use “add” instead to refer to creating a new task,
247279
to match the API symbol name.
248-
(These names were used in an earlier version the SE proposal.)
280+
(These names were used in an earlier version of the SE proposal.)
249281

250282
## suspension point
251283

TSPL.docc/Assets/[email protected]

20.6 KB
Loading

TSPL.docc/Assets/[email protected]

20.4 KB
Loading

TSPL.docc/Assets/[email protected]

37.6 KB
Loading

TSPL.docc/Assets/[email protected]

37.4 KB
Loading

TSPL.docc/Assets/[email protected]

6.12 KB
Loading

0 commit comments

Comments
 (0)