Skip to content

Commit e123da3

Browse files
authored
Consistently use "the Swift standard library" (#197)
In context, there's only one "standard library" for Swift, so it's unlikely someone would misread that to meaning anything other than "the Swift standard library". But it's still worthwhile to be consistent. Per discussion with Chuck in another edit, circa May 2023. Fixes: rdar://110033045
2 parents 54b2b2f + 64c36e0 commit e123da3

File tree

8 files changed

+29
-18
lines changed

8 files changed

+29
-18
lines changed

Style.md

Lines changed: 15 additions & 4 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:
@@ -169,7 +169,7 @@ For example:
169169
> custom classes and structures don’t have an implementation of
170170
> the *equal to* operator (`==`) or *not equal to* operator (`!=`).
171171
> You usually implement the `==` operator,
172-
> and use the standard library’s default implementation of the `!=` operator
172+
> and use the Swift standard library’s default implementation of the `!=` operator
173173
> that negates the result of the `==` operator.
174174
> There are two ways to implement the `==` operator.
175175
@@ -247,6 +247,17 @@ By design, actors specifically *avoid* having shared mutable state —
247247
their mutable state is private,
248248
and accessible only through the actor's (async) methods.
249249

250+
## standard library
251+
252+
Spell out in full as “the Swift standard library“ on the first use.
253+
If context already makes it clear
254+
and repeating the full name becomes wordy,
255+
you can shorted it to just “the standard library”
256+
in continued discussion.
257+
(We currently don‘t have any examples of doing that.)
258+
259+
Not “stdlib“ or “the stdlib“.
260+
250261
## spawn, start
251262

252263
Use “add” instead to refer to creating a new task,

TSPL.docc/LanguageGuide/AdvancedOperators.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,14 +905,14 @@ By default, custom classes and structures don't have an implementation of
905905
the *equivalence operators*,
906906
known as the *equal to* operator (`==`) and *not equal to* operator (`!=`).
907907
You usually implement the `==` operator,
908-
and use the standard library's default implementation of the `!=` operator
908+
and use the Swift standard library's default implementation of the `!=` operator
909909
that negates the result of the `==` operator.
910910
There are two ways to implement the `==` operator:
911911
You can implement it yourself,
912912
or for many types, you can ask Swift to synthesize
913913
an implementation for you.
914914
In both cases,
915-
you add conformance to the standard library's `Equatable` protocol.
915+
you add conformance to the Swift standard library's `Equatable` protocol.
916916

917917
You provide an implementation of the `==` operator
918918
in the same way as you implement other infix operators:
@@ -1488,7 +1488,7 @@ see <doc:Attributes#resultBuilder>.
14881488
only if there's an implementation of the operator for that type.
14891489
You use ``Self`` to refer to the type that will conform to the protocol,
14901490
just like you do in other protocol requirements.
1491-
For example, the standard library defines the ``Equatable`` protocol
1491+
For example, the Swift standard library defines the ``Equatable`` protocol
14921492
which requires the ``==`` operator:
14931493
14941494
.. testcode:: protocolOperator

TSPL.docc/LanguageGuide/ClassesAndStructures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ This means that any structure and enumeration instances you create ---
306306
and any value types they have as properties ---
307307
are always copied when they're passed around in your code.
308308

309-
> Note: Collections defined by the standard library
309+
> Note: Collections defined by the Swift standard library
310310
> like arrays, dictionaries, and strings
311311
> use an optimization to reduce the performance cost of copying.
312312
> Instead of making a copy immediately,
@@ -694,7 +694,7 @@ but isn't a direct pointer to an address in memory,
694694
and doesn't require you to write an asterisk (`*`)
695695
to indicate that you are creating a reference.
696696
Instead, these references are defined like any other constant or variable in Swift.
697-
The standard library provides pointer and buffer types
697+
The Swift standard library provides pointer and buffer types
698698
that you can use if you need to interact with pointers directly ---
699699
see [Manual Memory Management](https://developer.apple.com/documentation/swift/swift_standard_library/manual_memory_management).
700700

TSPL.docc/LanguageGuide/Generics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ but requires one extension per requirement.
17331733
You can include a generic `where` clause on an associated type.
17341734
For example, suppose you want to make a version of `Container`
17351735
that includes an iterator,
1736-
like what the `Sequence` protocol uses in the standard library.
1736+
like what the `Sequence` protocol uses in the Swift standard library.
17371737
Here's how you write that:
17381738

17391739
```swift
@@ -1781,7 +1781,7 @@ The `makeIterator()` function provides access to a container's iterator.
17811781
17821782
that accepts a ranged of indexes it its subscript
17831783
and returns a subcontainer ---
1784-
similar to how ``Collection`` works in the standard library.
1784+
similar to how ``Collection`` works in the Swift standard library.
17851785
17861786
.. testcode:: associatedTypes-subcontainer
17871787
@@ -1942,7 +1942,7 @@ This generic subscript is constrained as follows:
19421942

19431943
- The generic parameter `Indices` in angle brackets
19441944
has to be a type that conforms to the `Sequence` protocol
1945-
from the standard library.
1945+
from the Swift standard library.
19461946
- The subscript takes a single parameter, `indices`,
19471947
which is an instance of that `Indices` type.
19481948
- The generic `where` clause requires

TSPL.docc/LanguageGuide/Protocols.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ you can define an extension to the `Collection` protocol
25122512
that applies to any collection whose elements conform
25132513
to the `Equatable` protocol.
25142514
By constraining a collection's elements to the `Equatable` protocol,
2515-
a part of the standard library,
2515+
a part of the Swift standard library,
25162516
you can use the `==` and `!=` operators to check for equality and inequality between two elements.
25172517

25182518
```swift

TSPL.docc/LanguageGuide/StringsAndCharacters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ welcome.removeSubrange(range)
11611161
-->
11621162

11631163
<!--
1164-
TODO: Find and Replace section, once the standard library supports finding substrings
1164+
TODO: Find and Replace section, once the Swift standard library supports finding substrings
11651165
-->
11661166

11671167
> Note: You can use the `insert(_:at:)`, `insert(contentsOf:at:)`,

TSPL.docc/ReferenceManual/Declarations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3486,7 +3486,7 @@ binds more tightly to its operands.
34863486
> can't be used next to each other without grouping parentheses.
34873487
34883488
Swift defines numerous precedence groups to go along
3489-
with the operators provided by the standard library.
3489+
with the operators provided by the Swift standard library.
34903490
For example, the addition (`+`) and subtraction (`-`) operators
34913491
belong to the `AdditionPrecedence` group,
34923492
and the multiplication (`*`) and division (`/`) operators
@@ -3518,7 +3518,7 @@ The *assignment* of a precedence group specifies the precedence of an operator
35183518
when used in an operation that includes optional chaining.
35193519
When set to `true`, an operator in the corresponding precedence group
35203520
uses the same grouping rules during optional chaining
3521-
as the assignment operators from the standard library.
3521+
as the assignment operators from the Swift standard library.
35223522
Otherwise, when set to `false` or omitted,
35233523
operators in the precedence group follows the same optional chaining rules
35243524
as operators that don't perform assignment.

TSPL.docc/ReferenceManual/Statements.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ they reserve the right to add new enumeration cases,
422422
and any code that interacts with that enumeration
423423
*must* be able to handle those future cases without being recompiled.
424424
Code that's compiled in library evolution mode,
425-
code in the standard library,
425+
code in the Swift standard library,
426426
Swift overlays for Apple frameworks,
427427
and C and Objective-C code can declare nonfrozen enumerations.
428428
For information about frozen and nonfrozen enumerations,
@@ -442,7 +442,7 @@ added a new case to the enumeration
442442
that doesn't have a corresponding switch case.
443443

444444
The following example switches over all three existing cases of
445-
the standard library's [`Mirror.AncestorRepresentation`](https://developer.apple.com/documentation/swift/mirror/ancestorrepresentation)
445+
the Swift standard library's [`Mirror.AncestorRepresentation`](https://developer.apple.com/documentation/swift/mirror/ancestorrepresentation)
446446
enumeration.
447447
If you add additional cases in the future,
448448
the compiler generates a warning to indicate

0 commit comments

Comments
 (0)